Mysql - How to grant privileges in mysql, Grant only select in mysql
How to grant privileges in mysql
To grant privileges in mysql first, it is must to know what permission has to be provided to the user, about his requirement and who is he for the application. Then you can provide required permission for the user.The prompt should now look like this:
# mysql -u admin -p your_password mysql>
Enter the following if the database user already exists.:
mysql> GRANT SELECT ON database.* TO user@'localhost';
If you intend to create a brand new user, then run this:
mysql> GRANT ALL ON mydb.mytbl TO 'someuser'@'somehost'; mysql> GRANT SELECT, INSERT ON mydb.mytbl TO 'someuser'@'somehost';
To provide access to all the tables of mydb or mydatabase
GRANT ALL ON mydb.* TO 'someuser'@'somehost'; GRANT SELECT, INSERT ON mydb.* TO 'someuser'@'somehost';
The topic on Mysql - How to grant privileges in mysql is posted by - Maha
Hope you have enjoyed, Mysql - How to grant privileges in mysqlThanks for your time