Create a Read Only MySQL User
There are times when you need account read only access to a database.
To create a read only database user MySQL, do the following steps:
-
Login as a MySQL administrator.
-
Create a new MySQL user account.
>>> CREATE USER 'dapenda'@'%' IDENTIFIED BY 'mypassword';
- Grant the SELECT only privilege to user.
>>> GRANT SELECT ON site.* TO 'dapenda'@'%';
- Reload grant privilege for re-read access table MySQL.
>>> FLUSH PRIVILEGES;
- Done.