# /etc/init.d/mysqld stop
# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
# mysql -u root mysql
mysql> use mysql;
mysql> update mysql.user set authentication_string=password('123456') where user='root';
mysql> flush privileges;
mysql> quit
mysql 5.7 初始化密码后需要更新密码
#mysql -uroot -p123456
mysql> use mysql;
mysql> alter user user() identified by "123456";
更新密码
网友评论