java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more

springboot项目mysql运行后遇到问题:

java.sql.SQLException: The server time zone value ‘Öйú±ê׼ʱ¼ä’ is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
在这里插入图片描述

解决方法:

修改配置文件

spring.datasource.url=jdbc:mysql://localhost:3306/users?characterEncoding=UTF-8&serverTimezone = GMT

在这里插入图片描述

异常2

Loading class com.mysql.jdbc.Driver'. This is deprecated. The new driver class iscom.mysql.cj.jdbc.Driver’. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.

意思是 mysqljdbc . driver被弃用了新的驱动类是“com.mysql.cjdbc.driver”。驱动程序通过SPI自动注册,而手动加载类通常是不必要的,解决方案如下:

解决方法:

修改配置文件
在这里插入图片描述

你可能感兴趣的:(springboot)