Mysqldump Export--Data + structure + (functions + stored procedures)

Source: Internet
Author: User

mysqldump--Export Tool


#导出某个数据库-structure + data

Shell>mysqldump-h192.168.161.124-uroot-pxxxxxx--opt db_name |gzip-9 >/db_bakup/db_name.gz

#导出某个数据库的表-structure + data + functions + stored procedures

Shell>mysqldump-h192.168.161.124-uroot-pxxxxxx--opt-r db_name |gzip-9 >/db_backup/db_name.gz # #整体移库建议用这个

#导出多个数据库

Shell>mysqldump-h192.168.161.124-uroot-pxxxxxx--opt--databases db_name1 db_name2 db_name3 |gzip-9 >/db_backup /mul_db.gz

#导出所有的数据库

Shell>mysqldump-h192.168.161.124-uroot-pxxxxxx--opt--all-databases |gzip-9 >/db_bak/all_db.gz

#导出某个数据库的结构

Shell>mysqldump-h192.168.161.124-uroot-pxxxxxx--opt--no-data db_name|gzip-9 >/db_bak/db_name.strcut.gz

#导出某个数据库的数据

Shell>mysqldump-h192.168.161.124-uroot-pxxxxxx--opt--no-create-info db_name|gzip-9 >/db_bak/db_ Naem.data.gz

#导出某个数据库的某张表

Shell>mysqldump-h192.168.161.124-uroot-pxxxxxx--opt db_name tbl_name |gzip-9 >/db_bak/db_name.tal_name.gz

# Export the structure of a table for a database

Shell>mysqldump-h192.168.161.124-uroot-pxxxxxx--opt--no-data db_name tal_name | gzip-9 >/db_bak/db_name.tal_name.struct.gz

#导出某个数据库的某张表的数据

Shell>mysqldump-h192.168.161.124-uroot-pxxxxxx--opt--no-create-info db_name tbl_name | gzip-9 >/db_bak/db_name.tbl_name.data.gz

##--opt==--add-drop-table +--add-locks +--create-options +--disables-keys +--extended-insert +--lock-tables +--quick +--set+charset

# #默认使用--opt,--skip-opt Disable--opt parameter


Mysqldump Export--Data + structure + (functions + stored procedures)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.