How to create MySQL read only user

To create a MySQL database user with read-only access to a database, use the following command

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.

Advertisement

USER_NAME = username of the read-only user

PASSWORD = password of the read-only user.

Add a comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Advertisement