Mysql – Which databases does `thesqlpump` ignore by default

MySQLmysql-5.7

If I run the following command:

mysqlpump > mysqlpump.sql

Is there any documentation, a SQL query that can be run, or perhaps a config file that contains a complete list of databases that mysqlpump ignores by default?

According to this Percona blog post, the following databases are ignored by default:

  • INFORMATION_SCHEMA
  • ndbinfo
  • performance_schema
  • sys

However, this list was written in 2017 and seems incomplete. I've seen other documentation which indicates that mysqlpump also ignores tables in the mysql database.

Best Answer

The easiest way to know is to test, on Percona Server for MySQL 5.7.28 (latest as of this writing) it shows that mysqlpump includes the mysql schema in the backup:

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysql` /*!40100 DEFAULT CHARACTER SET latin1 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mytest` /*!40100 DEFAULT CHARACTER SET latin1 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */;