Create a new MySQL database using Workbench
Asked Answered
M

3

8

I'm just trying to create a new MySQL database with a few simple tables.

I created a new EER Model in Workbench so I have the database modeled I want it, with all the tables/fields I need. I don't see any way to take the model and create an actual database out of it. Right now it just created a .mwb "MySQL Workbench file".

I saw this question which is outdated as it's for Workbench (5.2.33) and it talks about "on the left pane there is a section titled 'Object' " which doesn't appear to exist in (5.2.36).

Does Workbench even have the capabilities to create a database or is it only for connecting/editing existing databases? If Workbench can't create new databases, what is a simple tool that will?

I'm using MySQL Workbench (5.2.36) on Win 7.

Mayonnaise answered 31/1, 2012 at 21:51 Comment(0)
C
7

I believe you want to select the "Database" menu and then select "Forward Engineer".

Claudetteclaudia answered 31/1, 2012 at 21:55 Comment(2)
closer, when I try to execute the SQL script to create the database I get "Operation failed: Can't connect to MySQL server on '127.0.0.1' (10061)" any ideas there?Mayonnaise
@jb: Based on the error message, I'd assume your connection info isn't correct. As a side note, at a certain point of the "Forward Engineering" process, you have the option of copying the entire SQL script to the clipboard. So, at that point, you could just take the script and execute it however you wanted (e.g. import a .sql file, use PHPmyAdmin, or whatever).Claudetteclaudia
F
1

In Workbench's main menu select Database -> Forward Engineer. This should done what you ask for.

Faucal answered 31/1, 2012 at 22:15 Comment(0)
I
1

Yes you may create database from MySQL workbench. steps are in below.

In MySQL Work bench 6.0 CE.

  1. You launch MySQL Workbench.
  2. From Menu Bar click on Database and then select "Connect to Database"
  3. It by default showing you default settings other wise you choose you host name, user name and password. and click to ok.
  4. As in above define that you should click write on existing database but if you don't have existing new database then you may choose the option from the icon menu that is provided on below the menu bar. Now keep the name as you want and enjoy ....

If you have already made a database through phpmyadmin, wamp server and any way and you want to make the ER Diagram, you choose database and select Reverse Engineer and follow the steps you will get your tables with ER Diagram now you make relationships if not coming by default.

If you want to access your all database then select database menu and then select database connection, follow steps and provide info, you will get your list of all databases.

Thanks...

Igraine answered 22/10, 2013 at 10:1 Comment(1)
Welcome to SO. This is a high quality answer. Keep in this way! Also please consider attach a picture when you get enough reputation to do so.Tarp

© 2022 - 2024 — McMap. All rights reserved.