In Mysql Workbench, where is Synchronize Model with Database - mysql

As displayed in Mysql Database Synchronization documentation.
I cannot find this particular Synchronize Model with Database window / wizard under Database ->
I have Mysql Workbench 6.0.9.11421 build 1170 Community Edition

You must have a model open that you want to synchronize. Without an open model neither of the database actions (like forward engineering or synch) are possible.
Update:
Oh, I missed the exact menu item title. I was implicitely reading it as the existing ones. Well, sometimes items are renamed, so what you have in mind is now simply Database -> Synchronize Model...

Related

I lack the "model" meny inside mysql workbench

I get the model menu if I create a new model, but not in the tab of my created database.
I've put and connected the database in google cloud.
Do I have to import or export the database in order to get the "model"-menu and be able to do diagrams and such?
Also in my installed version (6.3) of workbench I don't get the white tri-partscreen that's in all the videos and screenshots, only the black screen with the models and connections.
The "tri-part" screen was removed in Workbench 6.0. For details, see "What is new in Workbench 6.0"
As for modeling, keep in mind that modeling is a separate operation from your database. In other words, people can create and edit models without a MySQL Server, and later synchronize (forward engineer) the model with (to) the MySQL database. Or, one can create a model from a database (reverse engineer), edit the model, then synchronize it back to the database. For details, see "Forward and Reverse Engineering

MySQL Workbench 6 - difference in creating database / schema as a model and within a MySQL Connector

I was rooting MySQL Workbench and I had a TILT.
In MySQL Workbench initial screen there are two things I did not understand.
When creating a connection and access this, I have the option of creating schemas / databases and create your tables, scripts, etc. .. If I create a database named example, I only have the option to create the tables by script, not by EER diagram.
Returning to the MySQL Workbench initial screen, there is also the option of creating a model (for me it is a schema / database in the same way). If we create a model named example, as in the previous item within this you can create scripts, views, tables, and have the distinction of creating EER diagrams.
What I wanna know is:
Why there are options of create schemas / databases as models and within MySQL Connections?
why I can create schemas / databases with the same name in both options to create schemas / databases (MySQL Connectors and Models) without naming conflicts happen?
If they are the same thing, why when I create a model MySQL Connector does not synchronize automatically to recognize the model?
If they are the same thing, that I can create EER Diagram for schema / database in the Model and not in MySQL Connector?
Thanks to anyone who can answer me these questions.
You started from the wrong premise. Models and connections are two completely different things (why would there be different sections in MySQL Workbench if not?).
Via connections you can reach a server and work on it. Create users, retrieve data, create db objects etc.
Modeling is however the task to design a database structure. All the objects you create only exist within that model. You can design your structure from a higher level of view instead of going down to the pure SQL (which you can too, if you want). Nothing reaches a server until you either forward engineer your model or synchronize it to that server. The first is simply creating all the objects as you designed them, the latter is a two-way 'merge', that is, a diff is generated between the model and the server content and changes are applied to make the structure on the server be the same as in the model and vice versa.
Understanding that fundamental difference answer all your questions above.

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.

How to do a query in Mysql WorkBench?

I have an .sql script that contains inserts and creates tables. I used the "Create EER Model From Script"
It created the tables but I can't see the data inside these tables.
I went to the query menu and tried to make a query but it gives me an error about not being able to connect to localhost.
Am I doing it right?
As documented under Create EER Model from SQL Script:
Clicking this action item launches the Reverse Engineer SQL Script wizard. This is a multi-stage wizard that enables you to select the script you want to create your model from.
For further information, see Section 7.7.9.1, “Reverse Engineering Using a Create Script”.
Following that link:
However, if you are working with a script that also contains DML statements you need not remove them; they will be ignored.
Instead, you want the Manage Data Import/Export option under Server Administration (within the Workspace section of the Home window).
You are confusing things here. Creating a model from a script is a process where meta data is examined and a model is created that you can then use to modify your schema structure, further design your db objects and all that. Modeling is a design process for the structure of your schema/db so it only deals with meta data. It's also used for documentation (e.g. in teams).
On the other hand there's normal sql work with existing db objects and/or actually creating/deleting/modifying db objects. In order to do the latter you must have an understanding of the design of the schema (which you could get by using the modeling part of MySQL Workbench, but not only by that). This is also the place to load a script, run it to insert data and such.
The error you mentioned regarding the connection is yet another problem and you need to solve this first to be able to even access your server. And yes, you have to install a server first somewhere. MySQL Workbench is a tool to visually work with your server(s) in opposition to the MySQL command line client which is a pure text interface (but still also a client application for your MySQL servers).
If you are on Windows and want a MySQL server installed locally (e.g. for testing) your best option is to download the MySQL Installer which greatly simplifies installing any of the tools from the MySQL family (server, client tools, connectors, documentation and more).

How to execute SQL queries inside MySQL workbench

I am developing an application using Django framework. As you may know the workflow is you first describe your objects in Python classes and then you synchronize the database.
I made a MySQL Workbench EER diagram. Since then I continued to develop the application, so the database model is not updated in the EER diagram nor the MySQL Workbench model.
I tried to synchronize it using the built-in feature "Synchronize with Any Source" of MySQL Workbench, but this feature is not working for some reason and causes a segmentation fault. The queries to be executed inside the MySQL Workbench model are displayed but at the last step I get an empty SQL alter script. I tried manually copying the queries in that script and clicking the "Execute" button, but I had no luck with that. I think MySQL stores queries internally. Anyway. I submitted the bug to MySQL Workbench developers here and now it is fixed, but not yet released. I am now looking for a workaround while waiting for the next release.
Although I have a specific problem, the question remains generic.
Is it possible to execute queries on the MySQL Workbench model in order to alter it?
Did you try the "Forward Engineer" option? It allows you to reflect all the changes that were made to your table relations directly to the database which is a pretty useful functionality.
There are some catches though like the inability to maintain existing data every time forward engineering is performed however this can be compensated by entering some example data which will be shipped with the ER diagram the next time you perform "Forward engineer".