Skip to content

Instantly share code, notes, and snippets.

@mmasashi
Created November 14, 2016 20:24
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mmasashi/165b0d73cdc632ffa5ae9a0919e3f3cf to your computer and use it in GitHub Desktop.
Save mmasashi/165b0d73cdc632ffa5ae9a0919e3f3cf to your computer and use it in GitHub Desktop.
Create read-only user on MySQL
CREATE USER r_only_user identified by 'password';
GRANT SELECT, SHOW VIEW, PROCESS, REPLICATION CLIENT ON *.* TO 'r_only_user'@'%' IDENTIFIED BY 'password';
GRANT SELECT, SHOW VIEW, PROCESS, REPLICATION CLIENT ON *.* TO 'r_only_user'@'localhost' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment