Login | Register RSS

Questions

All Questions
Apache [2]
Automotive [1]
Contracting [1]
Electronics [1]
Gardening [1]
Home [3]
Linux [20]
Miscellaneous [2]
MySQL [2]
Perl [1]
Tea [1]
WiFi [1]
Windows [1]

MySQL 
MySQL Tips
Posted on 08/05/2011

Use this command to create a new username, with a password, but no grant permissions.

CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';

Use this command to remove a username.

DROP USER 'username'@'localhost';

Use this command to grant permission to a specific user to read, add, edit & remove data from all tables of a given database. You can use '*.*', instead of 'database.*', if you want to revoke from all databases at one time. 

GRANT SELECT, INSERT, UPDATE, DELETE ON database.* TO 'username'@'localhost';
FLUSH PRIVILEGES;

Use this command to revoke the grant permission of a specific user to read, add, edit & remove data from all tables of a given database. You can use '*.*', instead of 'database.*', if you want to revoke from all databases at one time.

REVOKE SELECT, INSERT, UPDATE, DELETE ON database.* TO 'username'@'localhost';
FLUSH PRIVILEGES;

If you like this site or any of its content, please help promote it. Use the social media buttons below to help spread the word. Don't forget to post in the comments section.

  Print   Email
Latest Blog Posts:
Latest Pages:

© 2019 BuildDesignCreate.com • All Rights Reserved
Privacy PolicyAdvertise with UsContact UsSite Map