0

I use the root to create a new user, like this: enter image description here

I have no more operations on it. Then I use this user to log in: enter image description here

I try to do some operations like this: enter image description here

Here "test" is a database which I created before. Why can I do all the operations? I have not done any grant operation on the test user. When I come back to use the root user to log in, I also cannot revoke the privileges on test(database) for test(user), like this: enter image description here

I am really confused by these things, and this is my first time to ask question on StackExchange. My English is also not very good. If you cannot understand what I am talking about just tell me, I will reply soon.

2
  • first try to show which grants are present for test user. use show grants for 'test'@'localhost'; you may be having only usage privilege for 'test'@'localhost'. Commented Nov 24, 2014 at 7:08
  • Please have a look at dba.stackexchange.com/questions/13361/… Commented Nov 24, 2014 at 8:50

1 Answer 1

1

If I am not mistaken, the test Database is created by default.

In addition, the mysql.db table contains rows that permit all accounts to access the test database and other databases with names that start with test_. This is true even for accounts that otherwise have no special privileges such as the default anonymous accounts. This is convenient for testing but inadvisable on production servers. Administrators who want database access restricted only to accounts that have permissions granted explicitly for that purpose should remove these mysql.db table rows.

http://dev.mysql.com/doc/refman/5.0/en/default-privileges.html

Try to create a new DB with a different name and repeat your steps.

Hope this will help you.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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