许可协议: 署名-非商业性使用-禁止演绎 4.0 国际 转载请保留原文链接及作者。
mysql -uroot -p
Enter password: 【输入原来的密码】
mysql>use mysql;
mysql> update user set password=passworD("123456") where user='root';
mysql> flush privileges;
mysql> exit;
mysql> update user set authentication_string=passworD("123456") where user='root';
service mysql stop
mysqld_safe --skip-grant-tables &
mysql> use mysql;
mysql> UPDATE user SET password=password("123456") WHERE user='root';
mysql> flush privileges;
mysql> exit;
mysql> update user set authentication_string=passworD("123456") where user='root';