目录
1.Cannot add or update a child row: a foreign key constraint fails
2.The server time zone value '�й���ʱ��' is unrecognized or represents more than one time zone.
3.Public Key Retrieval is not allowed
1.Cannot add or update a child row: a foreign key constraint fails
新增,更新一个表的记录的时候,需要判断数据中的外键是否在被关联的表中存在。
2.The server time zone value '�й���ʱ��' is unrecognized or represents more than one time zone.
mysql 8.0以上,添加了许多新特性,安全性也得到提升,提示需要添加时区,如下
url地址后面加上serverTimezone=UTC或者serverTimezone=Asia/Shanghai等
3.Public Key Retrieval is not allowed
在数据库连接URL后面添加:allowPublicKeyRetrieval=true参数
url: jdbc:mysql://localhost:3306/hrm?useUnicode=true&characterEncoding=utf-8 &useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai