AI智能
改变未来

mysql8.0 Public Key Retrieval is not allowed my.ini位置 not in GROUP BY clause only_full_group_by

java连接报错 Public Key Retrieval is not allowed

MySQL 8.0 时重启应用后提示 

com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Public Key Retrieval is not allowed

解决 连接后面加上 

allowPublicKeyRetrieval=true

[code]jdbc:mysql://localhost:3306/javalab?useUnicode=true&allowPublicKeyRetrieval=true

my.cnf在linux下,win下的my.ini 在C:\\ProgramData\\MySQL(要打开隐藏文件夹ProgramData)

 

临时解决  not in GROUP BY clause    this is incompatible with sql_mode=only_full_group_by问题

cmd root登录或者navicat命令行

set @@GLOBAL.sql_mode=\’\’;

set sql_mode =\’STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION\’;

永久解决my.ini 最后加上

# 设置sql_mode,去掉了ONLY_FULL_GROUP_BY
sql_mode=\’STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION\’

后重启,

然并卵,可能还要把myini放到哪个目录?  用着临时改的

赞(0) 打赏
未经允许不得转载:爱站程序员基地 » mysql8.0 Public Key Retrieval is not allowed my.ini位置 not in GROUP BY clause only_full_group_by