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...") |
|||
Line 2: | Line 2: | ||
<pre>FLUSH PRIVILEGES;</pre> | <pre>FLUSH PRIVILEGES;</pre> | ||
+ | |||
+ | |||
Use "*" instead if you want to refer to all databases. And use wildcard "%" instead of "localhost" for a public user. | Use "*" instead if you want to refer to all databases. And use wildcard "%" instead of "localhost" for a public user. | ||
[[Category: MySQL]] | [[Category: MySQL]] |
Latest revision as of 17: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.