How to create MySQL read only user
To create a MySQL database user with read-only access to a database, use the following command
1 |
GRANT SELECT, SHOW VIEW ON DB_NAME.* TO USER_NAME@'localhost' IDENTIFIED BY 'PASSWORD'; |
In the above SQL statement
DB_NAME = name of the database to which you need to give read-only access.
USER_NAME = username of the read-only user
PASSWORD = password of the read-only user.