Navicat无法连接Mysql8.0

  1. sql命令控制台,如果这段无法运行,将mysql安装目录的bin目录添加到环境变量中
mysql -uroot -p   
  1. 改加密方式
ALTER USER 'root'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER;     
  1. 改密码为password
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
  1. 刷新
FLUSH PRIVILEGES;

你可能感兴趣的:(mysql)