Tatva-Artha

meaning of "it"

mysql user management idiosyncracies

without comments

Ok, we are all used to adding new user in mysql with following command:

GRANT ALL ON [db].* TO [user].’%’ IDENTIFIED BY ‘[PASS]‘

So, what happens when you added user before creating the said database. Well, as I found out, mysql won’t complain. Oh well, so what happens if you create the database for the user after the fact. No, it won’t back fix the privileges.

So, I had to delete and recreate the user. Having not done this before, I just tried:

DROP USER [user]

and it worked! The only caveat here is if you added the original user for a particular host, you have to specify host when deleting, like this:

DROP User [user]@’[host]‘

Re-creating the user fixed the problem.

Enjoy!

http://www.tatvartha.com/wp-content/plugins/sociofluid/images/digg_16.png http://www.tatvartha.com/wp-content/plugins/sociofluid/images/reddit_16.png http://www.tatvartha.com/wp-content/plugins/sociofluid/images/stumbleupon_16.png http://www.tatvartha.com/wp-content/plugins/sociofluid/images/delicious_16.png http://www.tatvartha.com/wp-content/plugins/sociofluid/images/google_16.png http://www.tatvartha.com/wp-content/plugins/sociofluid/images/twitter_16.png

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

Written by Sharad

June 5th, 2009 at 7:26 pm

Posted in All,Technology

Tagged with

Leave a Reply