mysql 8.0使用时的2个问题

1、每次开机,都会报以下错误。需要设定时区。

om.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value '�й���׼ʱ��' is unrecognized or represents more than one time zone.

在my.ini中加上以下配置可以解决,必须放到mysqld 下,放入其它位置无效。配置文件默认位置是C:\ProgramData\MySQL\MySQL Server 8.0

default-time-zone = '+8:00'

2、重启mysql服务时,也会报错

Public Key Retrieval is not allowed

在连接数据库的url上添加参数就行

&allowPublicKeyRetrieval=true

你可能感兴趣的:(其它)