Mysqldump Backup command
-uroot Root User
-p123456 Password is 123456
The database where the MyDB table resides MyDB
MYTB the table that will be exported MYTB
>/opt/mytb.sql Backup to Mytb.sql
Export the entire database
The code is as follows |
Copy Code |
Mysqldump–opt-uroot-ppassword Database > Dump.sql |
?
How do I export it?
Export a single datasheet table
The code is as follows |
Copy Code |
Mysqldump–opt–add-drop-table-uroot-ppassword database table > Dump.sql |
Or
Don't forget to write the table name if you want to export only the table structure and data of the table Test1,test2,test3
The code is as follows |
Copy Code |
Mysqldump-uroot-p-D databasename test1 test2 test3 > Createtab.sql, |
Linux system
The code is as follows |
Copy Code |
#/usr/local/mysql/bin/mysqldump-uroot-p123456 MyDB MYTB >/opt/mytb.sql
|
Restores:
The code is as follows |
Copy Code |
#/usr/local/mysql/bin/mysql-uroot-p123456 MyDB </opt/mytb.sql |