mac 本地安装mysql遇到的坑

1.目前mysql 8以后的版本增加了新的密码验证方式,但是目前大多数第三方客户端不支持,所以建议使用原有的密码验证方式。

mac 本地安装mysql遇到的坑

2.java.sql.SQLException: null, message from server: "Host 'xxx' is not allowed to connect to this MySQL server"

是root用户对应的host不是远程对象,需要授权。

方法1:修改表结构

            mysql> use mysql;

            mysql> select user, host from user;

            mysql> update user set host = '%' where user = 'root';将root用户的host更改为%。

mac 本地安装mysql遇到的坑