如何使用 MySQL Workbench 进行 MySQL 数据库备份?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17190083/
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:59:01  来源:igfitidea点击:

How to take MySQL database backup using MySQL Workbench?

mysqldatabasemysql-workbenchdatabase-backups

提问by Viraj Dhamal

How to take database backup using MySQL Workbench? Can we take backup in the following ways-

如何使用 MySQL Workbench 进行数据库备份?我们可以通过以下方式进行备份-

  1. Backup file(.sql) contains both Create Table statements and Insert into Table Statements
  2. Backup file(.sql) contains only Create Table Statements, not Insert into Table statements for all tables
  3. Backup file(.sql) contains only Insert into Table Statements, not Create Table statements for all tables
  1. 备份文件(.sql)包含创建表语句和插入表语句
  2. 备份文件(.sql)只包含创建表语句,不包含所有表的插入表语句
  3. 备份文件(.sql)只包含Insert into Table Statements,不包含所有表的Create Table语句

回答by Viraj Dhamal

For Workbench 6.0

对于工作台 6.0

Open MySql workbench. To take database backup you need to create New Server Instance(If not available) within Server Administration.

打开 MySql 工作台。要进行数据库备份,您需要New Server InstanceServer Administration.

Steps to Create New Server Instance:

创建步骤New Server Instance

  1. Select New Server Instanceoption within Server Administrator.
  2. Provide connection details.
  1. 中选择New Server Instance选项Server Administrator
  2. 提供连接详细信息。

After creating new server instance , it will be available in Server Administrationlist. Double click on Server instance you have created OR Click on Manage Import/Exportoption and Select Server Instance.

创建新的服务器实例后,它将在Server Administration列表中可用。双击您创建的服务器实例或单击Manage Import/Export选项并选择服务器实例。

Now, From DATA EXPORT/RESTOREselect DATA EXPORToption,Select Schema and Schema Object for backup.

现在,从DATA EXPORT/RESTORE选择DATA EXPORT选项中,选择要备份的架构和架构对象。

You can take generate backup file in different way as given below-

您可以采用不同的方式生成备份文件,如下所示 -

Q.1) Backup file(.sql) contains both Create Table statements and Insert into Table Statements

Q.1) 备份文件 (.sql) 包含 Create Table 语句和 Insert into Table 语句

ANS:

答案:

  1. Select Start Export Option
  1. 选择开始导出选项

Q.2) Backup file(.sql) contains only Create Table Statements, not Insert into Table statements for all tables

Q.2) 备份文件(.sql) 只包含Create Table Statements,不包含所有表的Insert into Table 语句

ANS:

答案:

  1. Select Skip Table Data(no-data)option

  2. Select Start Export Option

  1. 选择Skip Table Data(no-data)选项

  2. 选择开始导出选项

Q.3) Backup file(.sql) contains only Insert into Table Statements, not Create Table statements for all tables

Q.3)备份文件(.sql)只包含Insert into Table Statements,不包含所有表的Create Table语句

ANS:

答案:

  1. Select Advance Option Tab, Within TablesPanel- select no-create info-Do not write CREATE TABLE statement that re-create each dumped tableoption.
  2. Select Start Export Option
  1. 选择高级选项选项卡,在Tables面板内 - 选择no-create info-Do not write CREATE TABLE statement that re-create each dumped table选项。
  2. 选择开始导出选项

For Workbench 6.3

对于工作台 6.3

  1. Click on Management tab at left side in Navigator Panel
  2. Click on Data Export Option
  3. Select Schema
  4. Select Tables
  5. Select required option from dropdown below the tables list as per your requirement
  6. Select Include Create schema checkbox
  7. Click on Advance option
  8. Select Complete insert checkbox in Inserts Panel
  9. Start Export Workbench 6.3 export
  1. 单击导航器面板左侧的管理选项卡
  2. 单击数据导出选项
  3. 选择架构
  4. 选择表格
  5. 根据您的要求从表格列表下方的下拉列表中选择所需的选项
  6. 选择包括创建架构复选框
  7. 点击高级选项
  8. 在“插入”面板中选择“完成插入”复选框
  9. 开始导出 工作台 6.3 导出

For Workbench 8.0

对于工作台 8.0

  1. Go to Servertab
  2. Go to Database Export
  1. 转到服务器选项卡
  2. 转到数据库导出

This opens up something like this

这打开了这样的东西

MySQL Workbench

MySQL 工作台

  1. Select the schema to export in the Tables to export
  2. Click on Export to Self-Contained file
  3. Check if Advanced Options...are exactly as you want the export
  4. Click the button Start Export
  1. 在要导出的表中选择要导出的架构
  2. 单击导出到自包含文件
  3. 检查高级选项...是否与您想要的导出完全一样
  4. 单击按钮开始导出

回答by cyber8200

Sever >Data Export

服务器>数据导出

enter image description here

在此处输入图片说明

Select database, and start export

选择数据库,开始导出

enter image description here

在此处输入图片说明

回答by daticon

  1. On ‘HOME' page -- > select 'Manage Import / Export' under 'Server Administration'

  2. A box comes up... choose which server holds the data you want to back up.

  3. On the 'Export to Disk' tab, then select which databases you want to export.

  4. If you want all the tables, select option ‘Export to self-contained file', otherwise choose the other option for a selective restore

  5. If you need advanced options, see other post, otherwise then click ‘Start Export'

  1. 在“主页”页面上 --> 在“服务器管理”下选择“管理导入/导出”

  2. 出现一个框...选择哪个服务器保存您要备份的数据。

  3. 在“导出到磁盘”选项卡上,然后选择要导出的数据库。

  4. 如果需要所有表,请选择“导出到自包含文件”选项,否则选择其他选项进行选择性还原

  5. 如果您需要高级选项,请参阅其他帖子,否则单击“开始导出”

回答by Adiii

In Window in new version you can export like this

在新版本的窗口中,您可以像这样导出

enter image description hereenter image description here

在此处输入图片说明在此处输入图片说明

enter image description here

在此处输入图片说明

回答by Mike Lischke

The Data Export function in MySQL Workbench allows 2 of the 3 ways. There's a checkbox Skip Table Data (no-data)on the export page which allows to either dump with or without data. Just dumping the data without meta data is not supported.

MySQL Workbench 中的数据导出功能允许使用 3 种方式中的 2 种。Skip Table Data (no-data)导出页面上有一个复选框,可以使用或不使用数据进行转储。不支持仅转储没有元数据的数据。

回答by Manfred

In Workbench 6.3 it is supereasy:

在 Workbench 6.3 中,它非常简单:

  1. On the "HOME"-view select one of the MySQL Connections: (localhost)
  2. In the "Localhost" view click on "Server"--> "Data export"
  3. In the "Data Export" view select the table(s) and whether you want to export only their structure, or structure and data,...
  4. Click "Start Export"
  1. 在“主页”视图上选择 MySQL 连接之一:(本地主机)
  2. 在“Localhost”视图中点击“Server”-->“Data export”
  3. 在“数据导出”视图中选择表,以及您是否只想导出它们的结构,或结构和数据,...
  4. 点击“开始导出”

回答by Swapnil Shende

In workbench 6.0 Connect to any of the database. You will see two tabs.

在工作台 6.0 中连接到任何数据库。您将看到两个选项卡。

1.Management2. Schemas

1. Management2.Schemas

By default Schemastab is selected. Select Managementtab then select Data Export. You will get list of all databases. select the desired database and and the file name and ther options you wish and start export. You are done with backup.

默认情况下Schemas选择选项卡。选择Management选项卡,然后选择Data Export。您将获得所有数据库的列表。选择所需的数据库和文件名以及您希望的选项并开始导出。您已完成备份。

回答by Rob Sedgwick

In Workbench 6.3 go to Server menu and then Choose Data Export. The dialog that comes up allows you to do all three things you want.

在 Workbench 6.3 中,转到服务器菜单,然后选择数据导出。出现的对话框允许你做你想做的所有三件事。

回答by Tính Ng? Quang

I am using MySQL Workbench 8.0: enter image description here

我正在使用MySQL Workbench 8.0在此处输入图片说明