Modifying users' privlleges in mysql; dropping; privillege by table only
Hi guys,
I've learnt how to create new accounts in mysql using both GRANT statement, or direct insertion of values into the tables using INSERT follow by FLUSH privilleges
If I want to modify the user's privillege.. say I decide to give him a bit more access.. how do I do it? Will issuing a grant statement using the same userid over write the current one? Or do I have to manually update the tables?
Also, how do I remove the users... just by using this?
DROP USER userid?
This will drop all userid for this guy right? What if I just want to drop him base on the hostname?
added: one more thing: mysql doc teaches set privilleges by database.. or ALL database. I took it upon myself that I can give user access to only CERTAIN TABLES by replacing "GRANT PRIVILLEGES ON database.*" to become GRANT PRIVILLEGES ON database.tablename to...
Am I right?
Also, this will only update mysql.tables_priv table instead in mysql.db tables, since it doesn't affect the entire database. Am I right to say that?
Because I created an account and that's what I saw the changes... as mysqldoc only mention changes to mysql.db... in my case.. for individual tables privilleges settings, mysql.tables_priv had changes instead...
added: i just realise what i did above, though using the enwly created account to login i can only see the specified tables that i give privillege to... i can't select,update whatsoever though i have already mentioned "grant select, update, insert, delete...."
in mysql.tables_priv, in the tables_priv column, the mentioned allowed commands are specify there, but in mysql.user, all the privilleges are set to 'N'
So do I have to manually go enable it.. by updating the mysql.user table?
Also, if i give select privillge via mysql.user, but for a specified table i don want to give access for SELECT, will mysql.user overwrite what is mention in mysql.tables_priv?
Please advise
thanks guys!
Last edited by Swakoo; 11-13-2005 at 10:11 PM.
|