Workbench's expertise is to create a table structure, and then in the structure diagram, the circle point Point, it is easy to use a visual way to build the database, and then import into the database server, this method is efficient. But sometimes we have a need, without building a table structure model, but using other database software built database, and we also want to use Workbench table structure model in the above modification, at this time, how the existing database exported to the model table structure is the focus!
Can do this:
How do I import a database?
There are a lot of people can not find the upgraded workbench in the browsing data function, think it is not, is wrong, is
Here is the write SQL statement
Usage when importing data
What if you want to modify a field after you finish building the table? See figure
Alternative import: said it alternative import is because at that time based on the original export SQL statements, generally exported there are two, 1 directly exported the database name, and then do not have to create a database directly into the SQL file immediately; 2 exports only data, no database name is exported. This kind of alternative refers to this situation. See
One of the keys is very discreet, such as
You know the primary key is automatically added index, but is not the primary key to do, of course, can also add, see
Click Index in the table to see the manual index, such as if the field to set a default value, such as
Here is a bit of a different kind of usage, that is, the enumeration type, the general just beginners seldom use it
How to view the relationship of the table, this feature is probably also Workbench's specialty (why many PHP programmers like to use it for reasons)
To increase the association of tables and tables, it is important to note that the relationship in the database is the most difficult to design, and Workbench has a unique tool in this area, instead of manual tedious work, with tools to create a relationship with a drag. Note that when an association is established, an associated field is added to the first table, and if you suspect that the field is too long you can change it, and this field simulates manually increasing the index automatically plus its index. This can be seen by clicking on the field after the table is built to see its properties. It's a great feature, huh!
A function that can improve productivity
MySQL Workbench How to export an existing database to an ER model