我正在使用:MySQL Workbench 8.0、Spring Tool Suite 3.9.7 和 JDK 11。(这是我拥有的一切)
我想创建数据库连接,但我收到此错误:
java.sql.SQLException: The server time zone value 'Közép-európai téli idõ' 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.
完整的错误在这里:https://hastebin.com/zimibuvafa.sql
应用程序属性
spring.jpa.hibernate.ddl-auto=update
spring.datasource.url=jdbc:mysql://localhost:3306/test1
spring.datasource.username=root
spring.datasource.password=adam
spring.mvc.view.prefix: /jsp/
spring.mvc.view.suffix: .jsp
spring.jpa.show-sql=true
密码、用户名、测试名称正确。
pom.xml:https://hastebin.com/oyufeporit.xml
最后,我用实体类创建了一个正确的实体包。 (因为 os 连接)--> @Entity、Getters-Setter 等
谢谢你所做的一切。
亚当
最佳答案
更换线路
spring.datasource.url=jdbc:mysql://localhost:3306/test1
到
jdbc:mysql://localhost:3030/db?test1=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
并添加另一行spring.datasource.driverClassName=com.mysql.jdbc.Driver
关于mysql - 如何解决这个 pom.xml 问题? (连接到数据库),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54448625/