国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 數據庫 > MySQL > 正文

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

2024-07-24 13:12:44
字體:
來源:轉載
供稿:網友

mysql進行完整備份時使用--all-database參數

比如:

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

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

問題:

想要在mysqldump備份數據庫的時候,過濾掉某些庫。

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

如下:備份數據庫的時候過濾掉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完整備份時過濾掉某些庫的方法就是小編分享給大家的全部內容了,希望能給大家一個參考,也希望大家多多支持VeVb武林網。


注:相關教程知識閱讀請移步到MYSQL教程頻道。
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 天门市| 西安市| 广河县| 祥云县| 霍州市| 扶风县| 留坝县| 濮阳县| 化德县| 神木县| 永嘉县| 安宁市| 哈尔滨市| 遵义市| 吉木萨尔县| 汪清县| 巴林左旗| 石首市| 凭祥市| 光山县| 普洱| 工布江达县| 安平县| 舟曲县| 广水市| 洛川县| 兴安盟| 绥化市| 孝感市| 行唐县| 云霄县| 桃园市| 枣庄市| 沙坪坝区| 黎城县| 昌都县| 略阳县| 枞阳县| 喀喇| 济阳县| 若羌县|