我想拿整个数据库。我在哪里可以找到数据库文件?
有没有办法将带有所有数据的整个数据库写入文本文件(如 SQL Server 中的文件)?
我想拿整个数据库。我在哪里可以找到数据库文件?
有没有办法将带有所有数据的整个数据库写入文本文件(如 SQL Server 中的文件)?
Database > Reverse Engineer
并按照提示进行操作。该向导将引导您连接到您的实例、选择您的数据库以及选择您想要逆向工程的对象类型。全部完成后,您将拥有至少一个名为MySQL模型的新选项卡。您可能还有一个名为EER 图的选项卡,它很酷但与此处无关。Database > Forward Engineer
Copy to Clipboard
或Save to Text File
。The wizard will take you further, but if you just want the script you can stop here.
A word of caution: the scripts are generated with CREATE
commands. If you want ALTER
you'll have to (as far as I can tell) manually change the CREATEs to ALTERs.
This is guaranteed to work, I just did it tonight.
In MySQL Workbench 6, commands have been repositioned as the "Server Administration" tab is gone.
You now find the option "Data Export" under the "Management" section when you open a standard server connection.
there is data export option in MySQL workbech
I found this question by searching Google for "mysql workbench export database sql file". The answers here did not help me, but I eventually did find the answer, so I am posting it here for future generations to find:
Answer
In MySQLWorkbench 6.0, do the following:
Here is a screenshot for reference:
试试phpMyAdmin的导出功能。
我认为也有可能将数据库文件从一台服务器复制到另一台服务器,但我目前没有可用的服务器,因此无法对其进行测试。
在 MySQL Workbench 的顶部菜单中单击数据库,然后单击正向工程师。在您将看到的选项菜单中,确保设置了“为表生成插入语句”。
None of these worked for me. I'm using Mac OS 10.10.5 and Workbench 6.3. What worked for me is Database->Migration Wizard... Flow the steps very carefully
Surprisingly the Data Export in the MySql Workbench is not just for data, in fact it is ideal for generating SQL scripts for the whole database (including views, stored procedures and functions) with just a few clicks. If you want just the scripts and no data simply select the "Skip table data" option. It can generate separate files or a self contained file. Here are more details about the feature: http://dev.mysql.com/doc/workbench/en/wb-mysql-connections-navigator-management-data-export.html
in mysql workbench server>>>>>>export Data then follow instructions it will generate insert statements for all tables data each table will has .sql file for all its contained data