MySQL 5.5多出了兩個(gè)新數(shù)據(jù)庫
information_schema &
performance_schema
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
但是用mysqldump去備份這兩個(gè)數(shù)據(jù)庫的時(shí)候都會(huì)報(bào)錯(cuò)
mysqldump: Got error: 1044: Access denied for user 'root'@'localhost' to database 'information_schema' when using LOCK TABLES
mysqldump: Got error: 1142: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'cond_instances' when using LOCK TABLES
用--all-databases備份時(shí)也不會(huì)備份這兩個(gè)數(shù)據(jù)庫
官方文檔里解釋到:
http://dev.mysql.com/doc/refman/5.5/en/mysqldump.html
總結(jié)一下,如果一定要用mysqldump去備份這兩個(gè)數(shù)據(jù)庫不是不可以,但是得disable lock tables。 我用的是:
--database information_schema --lock-tables=0