Mysql Workbench - Create Database based on EER Model (Forward Enginner Options)

Asked

Viewed 9,800 times

3

Doubt:


In Workbench I created the table in EER Diagram and now I want to connect to Hostname 127.0.0.1.

The way I walk is Forward Engineer -> Next -> and then I have a lot of options, I have to select which ones?


Options:

  • Drop Object before Each Create
  • Object Generate DROP SCHEMA
  • (...)
  • You can put the image on which screen you stopped?

3 answers

3


It’s this screen here?

Opções do Forward Engineer do MySQL Workbench

Come on, one by one:

  • DROP Objects Before Each CREATE Object: deletes tables before re-creating them
  • Generate DROP SCHEMA: deletes the database/schema before creating it again
  • Skip Creation of FOREIGN KEYS: does not create foreign keys
  • Skip Creation of FK Index as well: does not create indexes for foreign keys (only if you check the previous option)
  • Omit schema Qualifier in Object Names: do not prefix objects with the schema name
  • Generate USE statements: use USE type statements
  • Generate Separate CREATE INDEX statements: do not create indexes within table generation commands
  • Add SHOW WARNINGS after Every DDL statement: select this option to add the commands of SHOW WARNINGS in the output; this displays any warnings when the output is executed, which is good for debugging purposes
  • Don’t create view placeholder Tables: _(ツ)_/
  • Do not create users. Only create privileges (Grants): does not create any user, only guarantees their access to the necessary tables (it is assumed that users are already created)
  • Generate INSERT statements for Tables: check this option if you edited rows to the generated tables and want them to be inserted
  • Disable FK checks for Inserts: disables checking foreign keys for Inserts.

References:

http://dev.mysql.com/doc/workbench/en/wb-forward-engineering-sql-scripts.html http://docs.oracle.com/cd/E17952_01/workbench-en/workbench-en.pdf

2

I’ll follow the menus of Wizard that appear to me on my machine (Fedora with Worbench in English):

  1. [Connect Options] host where you will connect. No your case, localhost or 127.0.0.1; Sets the user name and password and click on "Next".
  2. [Options] In the beginning, you should do Next, without any problem. All the options there are to use as migration - in if the database/tables already exist and you want to modify because you made modifications to the ER model. "Next"
  3. [Select Options] In this window you can choose if you want export/create only tables, Views (View Objects), Stored Procedurs (Routine Objects), Triggers and User Objects (User Object); "Next"
  4. [Review SQL Script] - you can review the changes that will be made in BD. You can change something you want but it’s not all necessary. "Next"

And you should have the database created in the host/database you defined.

I hope it helps!

0

I do this: create the bd in mysql then open the Workbench and create my EER diagram, give a Ctrl+shift+z and go forward... One thing I like to do is copy the sql that is generated, because if there is an error I open phpmyadmin select my bd and insert the sql that I copied and analyze the error to correct the same( but this is a case to part)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.