mysql>GRANT SELECT, INSERT, UPDATE, DELETE
->ON widgets.* TO widgetAdmin@localhost
->IDENTIFIED BY 'ilovewidgets';
Assuming that the user widgetAdmin did not yet exist when this query is executed, both the user and db tables will be updated with the necessary rows.
The above is taken from dev.mysql.com.You can also use assign all privileges to a user on a certain database. Following is the syntax.
mysql> GRANT ALL PRIVILEGES ON
-> test.* TO 'ketan'@'localhost'
-> IDENTIFIED BY 'ketans_password';
I find this command exceedingly useful ! A quick way to set up privileges of a user on a db.
Thanks Christoff !
ReplyDeleteKeep visiting my blog. I plan to become active now here :-).
Ketan
This comment has been removed by a blog administrator.
ReplyDeleteIt is remarkable, it is a valuable piece
ReplyDeleteHere in this command we are giving permission to ip address, i have a problem that my ip address is changing when my vplan is restarting. how can i give permission by using system name i.e domain name in alter command
ReplyDeleteWhat is your command Pradeep ?
ReplyDelete