Tutorial: linux system-mysql commonly used backup commands

1. Back up all tables in the db1 database (including the table structure and data, excluding the statement to create the db1 database)

mysqldump -h192.168.1.10 -uroot -p db1 > xxx.sql

2. Back up all tables in the db1 database (including the table structure and data, including the statement to create the db1 database)

mysqldump -h192.168.1.10 -uroot -p --databases db1 > xxx.sql

3. Back up the t1, t2, and t3 tables in the db1 database (including the table structure and data, excluding the statement to create the db1 database)

mysqldump -h192.168.1.10 -uroot -p db1 t1 t2 t3 > xxx.sql

4. Back up multiple (db1, db2) databases (including database statement and the structure and data of all tables)

mysqldump -h192.168.1.10 -uroot -p --databases db1 db2 > xxx.sql

5. Back up all databases (including database statement and the structure and data of all tables)

mysqldump -h192.168.1.10 -uroot -p --all-databases > xxx.sql

6. Back up all the table structures in the db1 database (only include the table structure, plus the -d parameter)

mysqldump -h192.168.1.10 -uroot -p -d db1 > xxx.sql

7. Back up the t1, t2, and t3 table structure in the db1 database (only the table structure is included, plus the -d parameter)

mysqldump -h192.168.1.10 -uroot -p -d db1 t1 t2 t3 > xxx.sql

8. Back up all table data in the db1 database (only table data, plus the -t parameter)

mysqldump -h192.168.1.10 -uroot -p -t db1 > xxx.sql

9. Back up the t1, t2, and t3 table data in the db1 database (only table data is included, plus the -t parameter)

mysqldump -h192.168.1.10 -uroot -p -t db1 t1 t2 t3 > xxx.sql

 

 

In addition, if you want to better improve your programming ability, learn C language and C++ programming! Overtaking in a curve, one step faster! I may be able to help you here~

UP has uploaded some video tutorials on learning C/C++ programming on the homepage. Those who are interested or are learning must go and take a look! It will be helpful to you~

Sharing (source code, actual project video, project notes, basic introductory tutorial)

Welcome partners who change careers and learn programming, use more information to learn and grow faster than thinking about it yourself!

Programming learning:

Programming learning:

Guess you like

Origin blog.csdn.net/weixin_45713725/article/details/114830676