Skip to content

Instantly share code, notes, and snippets.

@omar-yassin
Last active October 21, 2016 00:48
Show Gist options
  • Save omar-yassin/2784d1feb32882b40efec7f129dbd76c to your computer and use it in GitHub Desktop.
Save omar-yassin/2784d1feb32882b40efec7f129dbd76c to your computer and use it in GitHub Desktop.
mysql change password for user & change grants to read only
use mysql;
update user set password=PASSWORD('$new_password') where User='$user_name';
flush privileges;
# to change current user grants
revoke all privileges on *.* from 'user'@'%';
GRANT SELECT ON *.* TO 'user'@'%';
flush privileges;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment