MySQL test database¶
The mysql_test_database check reports test databases on a MySQL server.
Description¶
Some MySQL installations include a test database that, by default, all users can access, even anonymous users. They can also include privileges that enable anyone to access databases whose names start with test_. A test database that remains on a production server can expose data or let any user store data on the server.
The check runs SHOW DATABASES and lists the databases named test, or whose names match the test_% pattern. In this pattern, _ matches any single character, so names such as tests match as well. The check returns its finding with the Info severity.
Resolution¶
If you don’t use the reported databases, remove them:
- Back up any data that you want to keep.
- Run
mysql_secure_installationand answerywhen it asks whether to remove the test database and access to it. Alternatively, drop each database withDROP DATABASE, for example:DROP DATABASE test;
To remove other insecure defaults at the same time, such as anonymous users, review the other options of mysql_secure_installation.
Need more support from Percona?¶
Percona experts bring years of experience in tackling tough database performance issues and design challenges.