I've installed Ubuntu 12.10(quantal) and mysql-server-5.5.
When I execute:
drop user ''@'localhost';
create database `redmine`;
grant all on `redmine`.* to 'redmine'@'localhost';
User redmine@localhost can access not only redmine database, but also other databases.
How do I prevent him from accessing any database except redmine?
P.S. I can't reproduce this on other distributions. What is a proper behaviour? Is this a bug?
UPDATE1:
mysql> show grants;
+--------------------------------------------------------------+
| Grants for redmine@localhost |
+--------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'redmine'@'localhost' |
| GRANT ALL PRIVILEGES ON `redmine`.* TO 'redmine'@'localhost' |
+--------------------------------------------------------------+
2 rows in set (0.00 sec)
mysql> use test;
Database changed
mysql> show tables;
+----------------+
| Tables_in_test |
+----------------+
| x |
+----------------+
1 row in set (0.00 sec)