Solved

create MySQL database

Posted on 2006-07-07
4
204 Views
Last Modified: 2010-04-23
hi,
how do i create a MySQL database using code in vb 2005?
thanks
0
Comment
Question by:newyuppie
  • 2
  • 2
4 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
in short, run the command:
CREATE DATABASE <dbname>;
being connected to the MySQL server.

But I guess you problem is not that command?
0
 
LVL 13

Author Comment

by:newyuppie
Comment Utility
not exactly angelIII,

i use a third party provider (MySQLDirect from CoreLabs) that provides native .net provider including tableadapters and all.

anyway, the problem is how do i connect to the MySQL server (using my provider if you know how, or maybe with ODBC one from mysql site) when (in the case of MySQLDirect) i need to pass as a parameter the name of the database to connect to and that database is yet to be created.

maybe this is a problem of my provider, i don't know if you need to always (using any other provider) pass the database name to connect to MySQL server, could you instruct me in that maybe?

thanks
0
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
Comment Utility
usually, when connecting to mysql, without specifying a database, you get to the system database called "mysql". once connected, and assuming the user has the requested permissions, he can issue the create database statement, and then reconnect to that server specifying that database.

0
 
LVL 13

Author Comment

by:newyuppie
Comment Utility
angel, that works actually. i have connected the user to the mysql database and issued a create database statement, i didnt know you could create dbs from within another db.

thanks

0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now