MySQL - Read only privileges on a database for a user

Revision as of 16:08, 5 April 2020 by Ardaut (talk | changes) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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.