tags:

views:

14

answers:

1

Im trying to create my own database with MySQL Workbench and run some queries on it. I have MySQL server 5.1 running and can enter queries in the command line tool to ask for version number and such.

But how do I get the server to host the database that I created in Workbench? When I enter "use MijnDatabase" or "-u root@localhost -p MijnDatabase" it says the database cannot be found. This makes sense, "MijnDatabase" the database file name and it's not connected to the server in any way (also tried with "mydb" wich is the db name I see inside Workbench).

Anyway I'm missing the link between MySQL server and hosting an actual database file.

+1  A: 

When you create a database use only lower case letters and use underscore to separate words:

create database my_database;
use my_database;
show tables;

etc...

To connect to your database use:

mysql -u root -p

enter your password then

use my_database;
show tables;

etc...

I have not used MySQL Workbench but the command line and phpMyAdmin. I suggest you start using the command line to learn a little bit MySQL, then use a GUI tool. However the command line is your best teacher.

Have a look in the reference doc: http://dev.mysql.com/doc/refman/5.1/en/create-database.html . Lean how to create a user and grant him permission on the database.

rtacconi
Ok but then how can I edit this database graphically, in Workbench? And I still don't know how a database created in Workbench can be connected to the server :(
MrFox