Skip to content

Instantly share code, notes, and snippets.

@vincent178
Created May 22, 2014 06:27
Show Gist options
  • Save vincent178/32eb3602beddc9e75560 to your computer and use it in GitHub Desktop.
Save vincent178/32eb3602beddc9e75560 to your computer and use it in GitHub Desktop.
mysql login and change password
login without password
mysql -uroot
login using password
mysql -uroot -p
after login, change user password
mysql> use mysql;
SET PASSWORD FOR 'user-name-here'@'hostname-name-here' = PASSWORD('new-password-here');
UPDATE mysql.user SET Password=PASSWORD('new-password-here') WHERE User='user-name-here' AND Host='host-name-here';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment