Skip to content

Instantly share code, notes, and snippets.

@azhai
Last active August 29, 2015 13:56
Show Gist options
  • Save azhai/8949548 to your computer and use it in GitHub Desktop.
Save azhai/8949548 to your computer and use it in GitHub Desktop.
mysql 修改root密码
/etc/init.d/mysql stop
/etc/init.d/mysql start --skip-grant-tables
#回车输入空密码
mysql -u root -p
--执行SQL语句
UPDATE mysql.user SET Password=PASSWORD('my-new-password') WHERE User='root';
FLUSH PRIVILEGES;
quit;
/etc/init.d/mysql restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment