(Tips & Tricks) grant a mysql user

April 12, 2010

How to easily insert a mysqluser en give this user the right permissions?

For example: we want to give insert, update, delete , create, drop and alter privileges.

Answer >>

First create a database as mysql root-user:

$ mysqladmin -u root -p create databasename

Now login as root to mysql and do:

$ mysql -u root -p mysql
mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, ALTER ON databasename.* to ‘username’@’localhost’ IDENTIFIED BY ‘yoursecretpassword’;
mysql> flush privileges;

And you are done!

"To know recursion, you must first know recursion."

Powered by Wordpress. Theme by Shlomi Noach, openark.org
© 1997 - 2022 KwaLinux Trainingen | Algemene voorwaarden | KvK: 10147727 | BTW-id: NL001873211B65 | Disclaimer