简体   繁体   中英

Creating a database with MySQL Workbench from existing schema/model

I built a database schema (or Model?) with MySQL Workbench . I'd like to now make it into an actual database.

I've seen Forward and Reverse engineer options and can't find a clear answer on if either are what I need.

How can I turn this into an actual database?

This for mysql workbench version 6.0 and for exporting a schema .

Select tab MySQL Model
Select File->Export->Forward Engineer SQL Create

Place a file name to be exported in the Output SQL Script File, choose your options, next

Export MySQL table Objects,  
filter tables 

Then a file is created which you can import to your database and it creates schemas if not exists, creates tables if not exists.

In the case of models, you need to pay, many bucks, for a tool that creates schemas, tables, indexes, cascading, and all stuff associated to an existing data model .

In order to realize a modeled schema structure on a real server you would use either forward engineering or synchronization. The first is if you have just the model and want it to create all the objects in the target schema(s). Synchronization on the other hand is a means to synchronize your model and an existing schema (two-way). That is, objects not existing or changed in your model are created or adjusted on the server and vice versa. There's no need to create a separate SQL script and apply that manually.

For both action see the Database menue in MySQL Workbench when a model is open.

The official documentation has a relevant article.
http://dev.mysql.com/doc/workbench/en/wb-getting-started-tutorial-creating-a-model.html

Jump to step 11.

As of MySQL Workbench 8.0, go to the menu item Database > Forward Engineer . After specifying your database connection and model export options, you'll be able to create the database you have designed.

See MySQL Workbench Manual :: 9.4.1.2 Forward Engineering to a Live Server for details.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM