- mysqldump
1.查看mysqldump命令参数格式
2.具体操作(使用第一种格式 mysqldump [op] database [tables])
a.备份一个数据库(mysqldump mytest<对应database> -uroot -p >dump1.sql)
会把mytest数据库的表格和数据都存到dump.sql中
b.备份一张表(mysqldump mytest<对应database> student -uroot -p >dump2.sql)
可以看到,只是备份了一张表结构与其结构语句
c.备份某个库某张表某些数据(mysqldump --where id=? database table -uroot -p >filename.sql)
可以看到只备份了student表结构和一条id=2的数据
d.备份某个库多张张表某些数据(mysqldump --where id=? database table1 table2 -uroot -p >filename.sql)
可以看到分别取了两张表的id=2的数据
(十四)mysql常用命令之逻辑备份
猜你喜欢
转载自blog.csdn.net/weixin_38312719/article/details/94500127
今日推荐
周排行