时间:2021-07-01 10:21:17 帮助过:3人阅读
# /etc/init.d/mysqld stop
# mysqld_safe --skip-grant-tables &
# mysql
mysql> update mysql.user set authentication_string=‘‘ where user=‘root‘;
mysql> flush privileges;
mysql> alter user ‘root‘@‘%‘ identified by ‘123‘;
mysql> quit
# service mysqld restart
# mysql -uroot -p‘123‘ 用新的密码登陆成功
设置mysql8.0.12-root的密码
标签:mysql where root code auth pre cat 设置 ini