MySQL 如何通过mysql工作台将数据导入mysql数据库?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15884693/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 17:15:53  来源:igfitidea点击:

How can I import data into mysql database via mysql workbench?

mysqlmysql-workbench

提问by Abhishek

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 将其导入我的数据库?

回答by Vishy

  • Under Server Administrationon the Home window select the server instance you want to restore database to (Create New Server Instanceif doing it first time).
  • Click on Manage Import/Export
  • Click on Data Import/Restoreon the left side of the screen.
  • Select Import from Self-Contained Fileradio button (right side of screen)
  • Select the path of .sql
  • Click Start Importbutton at the right bottom corner of window.
  • 在主页窗口的服务器管理下,选择要将数据库还原到的服务器实例(如果是第一次执行,则创建新的服务器实例)。
  • 单击管理导入/导出
  • 单击屏幕左侧的数据导入/恢复
  • 选择从自包含文件导入单选按钮(屏幕右侧)
  • 选择.sql的路径
  • 单击窗口右下角的开始导入按钮。

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(旧的 pre-Oracle MySQL Admin 美容)进行备份/恢复工作。您仍然可以从谷歌搜索的可信来源下载它(搜索 MySQL Administrator 1.2.17)。

回答by aunindo

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 的回答相同。