Any database named test or whose name is prefixed with test would be allowed full access granted it for anonymous accounts. According to MySQL 5.0 Certification Study Guide (ISBN 0-672-32812-7), page 498 recommends the removal of anonymous accounts and the test database.
Since that writing, MySQL 5.1 has mysql.db populated with those two rows. I have not seen that documented anywhere. Just run
DELETE FROM mysql.db;
FLUSH PRIVILEGES;
DROP DATABASE test;
and all your worries will be gone !!!
Please refrain from naming any test databases test, or test_ < anything >
UPDATE
It is perfectly OK to have mysql.db clear, especially with test databases. MySQL had included test and test_% in mysql.db by default with all privileges. Anonymous logins could therefore access any test database. A simply disk attack could hurt the mysql installation. Here is an example:
USE test
CREATE TABLE rolando_tb (a int);
INSERT INTO rolando_tb VALUES (1);
INSERT INTO rolando_tb SELECT a FROM rolando_tb;
INSERT INTO rolando_tb SELECT a FROM rolando_tb;
INSERT INTO rolando_tb SELECT a FROM rolando_tb;
INSERT INTO rolando_tb SELECT a FROM rolando_tb;
Run insert 30 times and you get a 7GB table
Imagine creating several of these tables in the test database
Imagine creating a Stored Procedure in the test database
The possibilities are endless as long as test and test_% exist in mysql.db
This is not documented. It should be !!!
It is indeed a documentation error in the area of Installtion Security. +1 for catching that !!!!!