Re: new user has permission to existing database
Posted by:
Pura Vida
Date: September 26, 2013 09:14AM
I had same problem on version 5.6.13, see below.
- I created a new schema test1 and new user test1 to access
schema test1:
mysql> create schema test1;
Query OK, 1 row affected (0.00 sec)
mysql> create user test1@'localhost' identified by 'test1';
Query OK, 0 rows affected (0.00 sec)
mysql> create user test1@'%' identified by 'test1';
Query OK, 0 rows affected (0.00 sec)
mysql> grant select,update,insert,delete on test1.* to test1@'localhost' ;
Query OK, 0 rows affected (0.00 sec)
mysql> grant select,update,insert,delete on test1.* to test1@'%' ;
Query OK, 0 rows affected (0.00 sec)
- I verified the user test1 has no permission on other schemas.
select * from mysql.db where user='test1' and db != 'test1' ;
- But when I login as test1, this user can go to other schemas
to create and drop tables, although it cannot use mysql.
orcl$ mysql -h 127.0.0.1 -u test1 -ptest1
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.6.13-enterprise-commercial-advanced MySQL Enterprise Server - Advanced Edition (Commercial)
mysql> create table d (a int);
Query OK, 0 rows affected (0.11 sec)
mysql> drop table d;
Query OK, 0 rows affected (0.05 sec)
Why is that, and how can I solve this problem?