Skip to content

Instantly share code, notes, and snippets.

@MrChrisWeinert
Created June 15, 2020 20:13
Show Gist options
  • Save MrChrisWeinert/771de54f1c5635b0d5e988c63b7013f4 to your computer and use it in GitHub Desktop.
Save MrChrisWeinert/771de54f1c5635b0d5e988c63b7013f4 to your computer and use it in GitHub Desktop.
Generic mysql permission stuff (mostly for Wordpress)
connect:
sudo mysql --user=root
Show users and where they can connect from:
SELECT user,host FROM mysql.user;
Show user-specific privileges:
SHOW GRANTS FOR 'user'@'192.168.x.xx';
Update user privileges:
GRANT SELECT, INSERT, UPDATE, DELETE, ALTER ON `thisismydatabasename`.* TO `user`@`192.168.x.xxx`;
Persist changes (may be unnecessary)
flush privileges;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment