简体   繁体   English

Mysql Workbench-将SQL脚本从ER图导出到数据库

[英]Mysql Workbench - Exporting sql script from ER Diagram to database

I created a ER diagram with mysql workbench and I would like to forward engineer it to a specific empty database that is already created. 我使用mysql workbench创建了一个ER图,我想将其转发给已经创建的特定空数据库。

But the sql script generated with the forward engineer makes it to a database called 'mydb' and I can't import to the database I wish because all the commands at sql script refer to the 'mydb' database. 但是由前向工程师生成的sql脚本会将其存储到名为“ mydb”的数据库中,但我无法导入到我希望的数据库中,因为sql脚本中的所有命令均引用“ mydb”数据库。

Also, I didn't find at the Mysql Workbench how to change the database name that will be created by the forward engineer sql script. 另外,我在Mysql Workbench上找不到如何更改将由正向工程师sql脚本创建的数据库名称。

How should I proceed to create the database with the sql script and the proper name? 我应该如何继续使用sql脚本和适当的名称创建数据库?

You can change the schema name in the schema editor (this is only possible in a model, not when editing live objects in the SQL IDE). 您可以在模式编辑器中更改模式名称(这仅在模型中可用,而在SQL IDE中编辑活动对象时则不能)。 Double click on the schema tab: 双击模式选项卡:

在此处输入图片说明

This will open the schema editor where you can change the name. 这将打开模式编辑器,您可以在其中更改名称。

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

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