mysql8 找回密码和phpmyadmin登陆

配置下my.conf

default_authentication_plugin=mysql_native_password

追加

skip-grant-tables

重启动mysql,方法看你系统来

登陆操作

mysql 
use mysql;
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '你的密码'; 
FLUSH PRIVILEGES;
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'taiyangcheng_0408'; 
ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement
//提示这样,执行下如下,然后再执行刚才的
mysql> flush privileges

删除配置的

skip-grant-tables

你可能感兴趣的:(mysql8 找回密码和phpmyadmin登陆)