mysql-无法连接

mysql 安装后无法连接数据库 mysql安装 mysql初始化

mysql-5.8

错误提示: The server requested authentication method unknown to the client

use mysql;
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'root';

mysql-5.6

错误提示: 1045 access denied for user 'root'@'localhost' using password yes

mysql -uroot tip: 不要加p可以直接进入mysql系统
grant all privileges on *.* to root@'localhost' identified by 'root';
grant all privileges on *.* to root@'%' identified by 'root';
flush privileges;

相关资料

mysql-5.6-无法连接数据库
mysql-5.8-无法连接数据库

发表评论