首页 > 技术文章 > 数据库的数据备份

cnds168 2021-09-22 10:33 原文

1.[root@localhost ~]# mysqldump --all-databases -p123456 > /root/alldb.sql

mysqldump: [Warning] Using a password on the command line interface can be insecure.

备份所有的数据库   逻辑备份

2.[root@localhost ~]# mysqldump --databases vsftpd -p123456 > /root/vsftp.sql

mysqldump: [Warning] Using a password on the command line interface can be insecure备份单个数据表    逻辑备份

删除mysql中drop database vsftpd

 

[root@localhost ~]# mysql -p123456 < /root/vsftp.sql
mysql: [Warning] Using a password on the command line interface can be insecure.恢复vsftpd表  /登录mysql查看

 

 

 

推荐阅读