create MySQL database

hi,
how do i create a MySQL database using code in vb 2005?
thanks
LVL 13
newyuppieAsked:
Who is Participating?
 
Guy Hengel [angelIII / a3]Connect With a Mentor Billing EngineerCommented:
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
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
in short, run the command:
CREATE DATABASE <dbname>;
being connected to the MySQL server.

But I guess you problem is not that command?
0
 
newyuppieAuthor Commented:
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
 
newyuppieAuthor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.