I created a database in mysql. I have a .sql file. how can i import it into my database via mysql workbench ?
我在mysql中创建了一个数据库。我有一个.sql文件。如何通过mysql workbench将其导入我的数据库?
2 个解决方案
#1
44
- Under Server Administration on the Home window select the server instance you want to restore database to (Create New Server Instance if doing it first time).
- 在“主页”窗口的“服务器管理”下,选择要将数据库还原到的服务器实例(如果是第一次执行,则创建新服务器实例)。
- Click on Manage Import/Export
- 单击“管理导入/导出”
- Click on Data Import/Restore on the left side of the screen.
- 单击屏幕左侧的“数据导入/恢复”。
- Select Import from Self-Contained File radio button (right side of screen)
- 选择从自包含文件导入单选按钮(屏幕右侧)
- Select the path of .sql
- 选择.sql的路径
- Click Start Import button at the right bottom corner of window.
- 单击窗口右下角的“开始导入”按钮。
Hope it helps.
希望能帮助到你。
---Edited answer---
---编辑答案---
Regarding selection of the schema. MySQL Workbench (5.2.47 CE Rev1039) does not yet support exporting to the user defined schema. It will create only the schema for which you exported the .sql... In 5.2.47 we see "New" target schema. But it does not work. I use MySQL Administrator (the old pre-Oracle MySQL Admin beauty) for my work for backup/restore. You can still download it from Googled trustable sources (search MySQL Administrator 1.2.17).
关于模式的选择。 MySQL Workbench(5.2.47 CE Rev1039)尚不支持导出到用户定义的模式。它将仅创建导出.sql的模式...在5.2.47中,我们看到“新”目标模式。但它不起作用。我使用MySQL Administrator(旧的Oracle之前的Oracle Admin美容)来完成备份/恢复工作。您仍然可以从Googled可信来源下载它(搜索MySQL Administrator 1.2.17)。
#2
9
For MySQL Workbench 6.1: in the home window click on the server instance(connection)/ or create a new one. In the thus opened 'connection' tab click on 'server' -> 'data import'. The rest of the steps remain as in Vishy's answer.
对于MySQL Workbench 6.1:在主窗口中单击服务器实例(连接)/或创建一个新实例。在这样打开的“连接”选项卡中,单击“服务器” - >“数据导入”。其余的步骤仍然像Vishy的回答一样。
#1
44
- Under Server Administration on the Home window select the server instance you want to restore database to (Create New Server Instance if doing it first time).
- 在“主页”窗口的“服务器管理”下,选择要将数据库还原到的服务器实例(如果是第一次执行,则创建新服务器实例)。
- Click on Manage Import/Export
- 单击“管理导入/导出”
- Click on Data Import/Restore on the left side of the screen.
- 单击屏幕左侧的“数据导入/恢复”。
- Select Import from Self-Contained File radio button (right side of screen)
- 选择从自包含文件导入单选按钮(屏幕右侧)
- Select the path of .sql
- 选择.sql的路径
- Click Start Import button at the right bottom corner of window.
- 单击窗口右下角的“开始导入”按钮。
Hope it helps.
希望能帮助到你。
---Edited answer---
---编辑答案---
Regarding selection of the schema. MySQL Workbench (5.2.47 CE Rev1039) does not yet support exporting to the user defined schema. It will create only the schema for which you exported the .sql... In 5.2.47 we see "New" target schema. But it does not work. I use MySQL Administrator (the old pre-Oracle MySQL Admin beauty) for my work for backup/restore. You can still download it from Googled trustable sources (search MySQL Administrator 1.2.17).
关于模式的选择。 MySQL Workbench(5.2.47 CE Rev1039)尚不支持导出到用户定义的模式。它将仅创建导出.sql的模式...在5.2.47中,我们看到“新”目标模式。但它不起作用。我使用MySQL Administrator(旧的Oracle之前的Oracle Admin美容)来完成备份/恢复工作。您仍然可以从Googled可信来源下载它(搜索MySQL Administrator 1.2.17)。
#2
9
For MySQL Workbench 6.1: in the home window click on the server instance(connection)/ or create a new one. In the thus opened 'connection' tab click on 'server' -> 'data import'. The rest of the steps remain as in Vishy's answer.
对于MySQL Workbench 6.1:在主窗口中单击服务器实例(连接)/或创建一个新实例。在这样打开的“连接”选项卡中,单击“服务器” - >“数据导入”。其余的步骤仍然像Vishy的回答一样。