Mysqldump instances and mysqldump instances are excluded from database backup.
Note:
Use mysqldump-all-databases to export all databases. However, if the master node dumps data from the master database, we do not need or want information_schema or mysql database. When there are few databases, you can also use/usr/local/mysql/bin/mysqldump-uroot-p -- databases db1 db2> db1db2. SQL is re-exported in this way, but if there are too many data, it is very troublesome to specify this.
Mysql supports ignore-table, but does not have ignore-database. Therefore, if you want to export all databases except information_schema and mysql databases, can you only specify databases one by one?
Solution:
# Mysql-e "show databases;"-uroot-p | grep-Ev "Database | information_schema | mysql | test" | xargs mysqldump-uroot-p -- databases> mysql_dump. SQL
Appendix:
Appendix 1: mysqldump: Got error: 1142: SELECT, lock tabl command denied to user 'root' @ 'localhost' for table 'cond _ instances' when using LOCK TABLES
Performance_schema is added to mysql5.5. When we perform mysqldump, the following error message is returned:
Mysqldump: Got error: 1142: SELECT, lock tabl command denied to user 'root' @ 'localhost' for table 'cond _ instances' when using LOCK TABLES
We can add the parameter-skip-lock-tables in mysqldump, as shown in
# Mysqldump-uroot-p -- skip-lock-tables performance_schema> performance_schema. SQL or filter out the performance_schema Database
# Mysql-e "show databases;"-uroot-p | grep-Ev "Database | information_schema | mysql | test | performance_schema" | xargs mysqldump-uroot-p -- databases> mysql_dump. SQL
In the above mysqldump backup database, it is excluded that some database instances are all the content shared by Alibaba Cloud xiaobian. I hope you can provide a reference and support for the customer's house.