当我们在使用springboot启动项目时报:
Could not obtain connection to query metadata : 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.
是因为我们在连接数据库时application.properties没有创建serverTimezone:
解决办法在application.properties文件中的spring.datasource.url添加serverTimezone即可:
spring.datasource.url=jdbc:mysql://localhost:3306/db_book_system?serverTimezone=GMT&characterEncoding=utf-8