Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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@%                                                                                    |
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'@'' for table 'hello'

I'm sure there is a good explanation for this.

share|improve this question
Yup. I was creating databases starting with test_. – Mathieu Longtin Dec 13 '12 at 16:50
Rolando advises how to get rid of this issue (and vulnerability) – ypercubeᵀᴹ Dec 13 '12 at 16:52

After reading this (thanks @ypercube)

MySQL : Why are there "test" entries in mysql.db?

I removed the test entries from mysql.db and it fixed it. I then realized that all the test I'd ran were using database named like test_xxx. Creating database with a name not beginning in 'test_' was not working as expected.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.