Solved

create MySQL database

Posted on 2006-07-07
4
220 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]
ID: 17064474
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
ID: 17064738
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
ID: 17065884
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
ID: 17070521
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

810 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