0%

Mysql 连接的一些问题

Mysql 连接的一些报错及解决方案

Host ‘xxx.xx.xxx.xxx’ is not allowed to connect to this MySQL server

username 是用户名 password 是你的密码 localhost 是服务器

1
2
3
4
5
6
7
8
9
CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';

GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost' WITH GRANT OPTION;

CREATE USER 'username'@'%' IDENTIFIED BY 'password';

GRANT ALL PRIVILEGES ON *.* TO 'username'@'%' WITH GRANT OPTION;

FLUSH PRIVILEGES;

MySQL 8.0 - Client does not support authentication protocol requested by server; consider upgrading MySQL client

1
2
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
flush privileges;

参考文章