问题
How to take database backup using MySQL Workbench? Can we take backup in the following ways-
- Backup file(.sql) contains both Create Table statements and Insert into Table Statements
- Backup file(.sql) contains only Create Table Statements, not Insert into Table statements for all tables
- Backup file(.sql) contains only Insert into Table Statements, not Create Table statements for all tables
回答1:
For Workbench 6.0
Open MySql workbench.
To take database backup you need to create New Server Instance
(If not available) within Server Administration
.
Steps to Create New Server Instance
:
- Select
New Server Instance
option withinServer Administrator
. - Provide connection details.
After creating new server instance , it will be available in Server Administration
list. Double click on Server instance you have created OR Click on Manage Import/Export
option and Select Server Instance.
Now, From DATA EXPORT/RESTORE
select DATA EXPORT
option,Select Schema and Schema Object for backup.
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
ANS:
- Select Start Export Option
Q.2) Backup file(.sql) contains only Create Table Statements, not Insert into Table statements for all tables
ANS:
Select
Skip Table Data(no-data)
optionSelect Start Export Option
Q.3) Backup file(.sql) contains only Insert into Table Statements, not Create Table statements for all tables
ANS:
- Select Advance Option Tab, Within
Tables
Panel- selectno-create info-Do not write CREATE TABLE statement that re-create each dumped table
option. - Select Start Export Option
For Workbench 6.3
- Click on Management tab at left side in Navigator Panel
- Click on Data Export Option
- Select Schema
- Select Tables
- Select required option from dropdown below the tables list as per your requirement
- Select Include Create schema checkbox
- Click on Advance option
- Select Complete insert checkbox in Inserts Panel
- Start Export
回答2:
Sever >
Data Export
Select database, and start export
回答3:
On ‘HOME’ page -- > select 'Manage Import / Export' under 'Server Administration'
A box comes up... choose which server holds the data you want to back up.
On the 'Export to Disk' tab, then select which databases you want to export.
If you want all the tables, select option ‘Export to self-contained file’, otherwise choose the other option for a selective restore
If you need advanced options, see other post, otherwise then click ‘Start Export’
回答4:
In Window in new version you can export like this
回答5:
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.
回答6:
In Workbench 6.3 it is supereasy:
- On the "HOME"-view select one of the MySQL Connections: (localhost)
- In the "Localhost" view click on "Server"--> "Data export"
- In the "Data Export" view select the table(s) and whether you want to export only their structure, or structure and data,...
- Click "Start Export"
回答7:
In workbench 6.0 Connect to any of the database. You will see two tabs.
1.Management
2. Schemas
By default Schemas
tab is selected.
Select Management
tab
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.
回答8:
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.
回答9:
I am using MySQL Workbench 8.0:
来源:https://stackoverflow.com/questions/17190083/how-to-take-mysql-database-backup-using-mysql-workbench