1

I had followed these steps.

1) I log in as root user to mysql.

2) I create a new database named "studentdb".

3) I use that db and import db tables from sqldump.

4) I create new user for that studentdb and give that user certain privileges.

5) but when I check user select * from mysql.user; , I couldn't find the user that I have created.

6) so, when I check the newly created db by using this command, select * from mysql.db order by db;, I couldn't find it either.

7) but when I use show databases;, I can find the newly created database.

So, why I couldn't find the newly created db in step 6?

What might be my missing steps to use as a created user to that new database by using mysql -ublah -p studentdb?

1
  • Can you show the actual command you used to create the new user?
    – octern
    Jul 30, 2012 at 5:24

1 Answer 1

1

6) So, why I couldn't find the newly created db in step 6?

Table mysql.db is used to store access rights to databases by users/hosts. It doesn't contain all databases.

4
  • Thanks for explanation. why I can't log in with my created user, I think it wasn't created properly.. I think. So, I created next time and now can log in. But I accepted your answer even thought as it cover some of the points the I want to know.
    – kitokid
    Jul 30, 2012 at 5:46
  • one follow up: first time, I created my user using some specific ip instead of localhost. So for that kind of users , how can I view all user from mysql command?
    – kitokid
    Jul 30, 2012 at 5:51
  • select * from mysql.user; But you said that you couldn't find the user that you have created... May be you created user not in this mysql instance? Or you make a mistake in create/grant command?
    – CyberDem0n
    Jul 30, 2012 at 5:55
  • yah. I think I made mistake somewhere. So I couldn't see the user and log in. Now all ok.
    – kitokid
    Jul 30, 2012 at 6:02

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.