亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

mysql完整備份時過濾掉某些庫的方法

 更新時間:2017年03月23日 09:59:01   投稿:jingxian  
下面小編就為大家?guī)硪黄猰ysql完整備份時過濾掉某些庫的方法。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧

mysql進行完整備份時使用--all-database參數(shù)

比如:

#mysqldump -u root -h localhost -p --all-database > /root/all.sql

數(shù)據(jù)導入的時候,可以先登陸mysql數(shù)據(jù)庫中,使用source /root/all.sql進行導入。

問題:

想要在mysqldump備份數(shù)據(jù)庫的時候,過濾掉某些庫。

這種情況mysqldump備份的時候就不能使用--all-database了,而是使用--database。

如下:備份數(shù)據(jù)庫的時候過濾掉information_schema、mysql 、test和jkhw_db庫

[root@fangfull-backup ~]# mysql -uroot -p -e "show databases"
Enter password:

+--------------------+
| Database |
+--------------------+
| information_schema |
| hqsb_db               |
| jkhw_db             |
| mysql                 |
| test                    |
| tech_db             |
| hqtime_o2o_db |
| hq_o2o_db        |
| hqtime_o2o_db_new |
+--------------------+
9 rows in set (0.00 sec)

操作方法:

[root@fangfull-backup ~]# mysql -uroot -p -e "show databases"|grep -Ev "Database|information_schema|mysql|test|jkhw_db"
Enter password:
hqsb_db
tech_db
hqtime_o2o_db
hq_o2o_db
hqtime_o2o_db_new
[root@fangfull-backup ~]# mysql -uroot -p -e "show databases"|grep -Ev "Database|information_schema|mysql|test|jkhw_db"|xargs
Enter password:
hqsb_db tech_db hqtime_o2o_db hq_o2o_db hqtime_o2o_db_new
[root@fangfull-backup ~]# mysql -uroot -p -e "show databases"|grep -Ev "Database|information_schema|mysql|test|jkhw_db"|xargs mysqldump -uroot -p --databases > mysql_dump.sql
Enter password:

以上這篇mysql完整備份時過濾掉某些庫的方法就是小編分享給大家的全部內容了,希望能給大家一個參考,也希望大家多多支持腳本之家。

相關文章

最新評論