I'm baffled. I have a select only user, but somehow, the user can create a new database, and create table inside the new database. It can't create tables inside other db. It's really odd.
This is MariaDB 5.5.28.
$ mysql -upermtest -pxxx -h mysqlhost
...
Your MySQL connection id is 4355 to server version: 5.5.28-MariaDB-log
...
mysql> show grants;
+----------------------------------------------------------------------------------------------------------+
| Grants for permtest@% |
+----------------------------------------------------------------------------------------------------------+
| GRANT SELECT ON *.* TO 'permtest'@'%' IDENTIFIED BY PASSWORD '*XXX' |
+----------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> create database test_ddb_again;
Query OK, 1 row affected (0.00 sec)
mysql> use test_ddb_again;
Database changed
mysql> create table hello ( a int );
Query OK, 0 rows affected (0.01 sec)
mysql> use previously_existing_db;
Database changed
mysql> create table hello ( a int );
ERROR 1142 (42000): CREATE command denied to user 'permtest'@'10.30.25.51' for table 'hello'
mysql>
I'm sure there is a good explanation for this.