简体   繁体   English

MySQL Workbench 6-创建数据库/模式作为模型以及在MySQL Connector中的区别

[英]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. 我正在扎根MySQL Workbench,并且有一个TILT。 In MySQL Workbench initial screen there are two things I did not understand. 在MySQL Workbench初始屏幕中,有两件事我不理解。

  • 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 . 创建连接并访问该连接时 ,我可以选择创建模式/数据库并创建您的表,脚本等。.如果创建一个名为example的数据库,则只能选择按脚本创建表, 而不能按EER图
  • 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). 返回到MySQL Workbench的初始屏幕,还有创建模型的选项(对我来说,它是以相同的方式是一个模式/数据库)。 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 . 如果我们创建一个名为example的模型,如其中的上一个项目,则可以创建脚本,视图,表,并具有创建EER图区别

What I wanna know is: 我想知道的是:

  1. Why there are options of create schemas / databases as models and within MySQL Connections? 为什么在MySQL Connections中有创建模式/数据库作为模型的选项?

  2. 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? 为什么我可以在两个选项中创建具有相同名称的模式/数据库来创建模式/数据库(MySQL连接器和模型)而不会发生命名冲突?

  3. If they are the same thing, why when I create a model MySQL Connector does not synchronize automatically to recognize the model? 如果它们是同一回事,为什么在我创建模型时,MySQL Connector不会自动同步以识别模型?

  4. If they are the same thing, that I can create EER Diagram for schema / database in the Model and not in MySQL Connector? 如果它们是同一回事,那我可以在Model中而不是在MySQL Connector中为架构/数据库创建EER图?

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?). 模型和连接是完全不同的两件事(为什么MySQL Workbench中的部分不一样?)

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). 您可以从更高的角度来设计结构,而不必使用纯SQL(如果需要,也可以这样做)。 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. 了解这一根本差异可以回答以上所有问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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