Difference between revisions of "MySQL - Read only privileges on a database for a user"

(Created page with "<pre>GRANT SELECT ON MY-DATABASE.* TO 'USERNAME'@'localhost' IDENTIFIED BY 'MYPASSWORD';</pre> <pre>FLUSH PRIVILEGES;</pre> Use "*" instead if you want to refer to all datab...")
(No difference)

Revision as of 16:08, 5 April 2020

GRANT SELECT ON MY-DATABASE.* TO 'USERNAME'@'localhost' IDENTIFIED BY 'MYPASSWORD';
FLUSH PRIVILEGES;

Use "*" instead if you want to refer to all databases. And use wildcard "%" instead of "localhost" for a public user.