我们的服务器中有 40 个数据库。
我们想使用 mysqldump 进行 36 个数据库备份。如何在 mysqldump 命令中忽略剩余的 4 个数据库?mysqldump 是否有任何选项可以忽略 MySQL 中的备份数据库?
我知道一般的 mysqldump 命令,但它非常冗长。我只想忽略 4 个数据库并且需要进行剩余的 dbs 备份。
我的查询执行时间过长。请在这里帮助我。
mysql> explain
select pcm.catalog_id
from cat_produ_catal_map_defer pcm, cat_catal_catal_map_defer ccm, cat_catal_defer c
where
pcm.product_id = 2520000
and ccm.catalog_id = pcm.catalog_id
and ccm.parent_catalog_id = 1000025
and levels <> 0
and c.catalog_id = pcm.catalog_id
and c.precedence is not null
order by c.precedence;
+----+-------------+-------+------+--------------------------------------------+----------+---------+------------------------+------+-----------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------+------+--------------------------------------------+----------+---------+------------------------+------+-----------------------------+
| 1 | SIMPLE | c | ALL | idx_1031,idx_17109 | NULL | NULL | NULL | …Run Code Online (Sandbox Code Playgroud) 询问:
Select *
from `t_event`
where `create_user_id`=7
and (`event_create_date`)=('2012-12-18 00:00:00')
and `event_type_cd`=11
and `domain_id` =602
and `job_id` =1
limit 1
Run Code Online (Sandbox Code Playgroud)
表结构:
mysql> show create table t_event\G
*************************** 1. row ***************************
Table: t_event
Create Table: CREATE TABLE `t_event` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`create_user_id` int(11) DEFAULT NULL,
`event_create_date` date DEFAULT NULL,
`event_type_cd` int(11) NOT NULL,
`event_desc` varchar(512) NOT NULL,
`IsGlobalEvent` int(2) DEFAULT NULL,
`event_start_date` datetime NOT NULL,
`event_end_date` datetime NOT NULL,
`job_id` int(11) DEFAULT NULL,
`domain_id` int(11) NOT NULL,
PRIMARY …Run Code Online (Sandbox Code Playgroud)