[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

create MySQL database

Posted on 2006-07-07
4
Medium Priority
?
250 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 143

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 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 2000 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

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…
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

825 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