Java Can';在MYSQL工作台spring Boot中看不到MYSQL表信息

Java Can';在MYSQL工作台spring Boot中看不到MYSQL表信息,java,mysql,spring,spring-boot,hibernate,Java,Mysql,Spring,Spring Boot,Hibernate,我正在尝试将我的spring boot应用程序连接到MYSQL workbench,但在MYSQL workbench中找不到我的任何列 我的设置: 此application.properties文件 spring.datasource.url=jdbc:mysql://localhost:3306/blog?useUnicode=true&useLegacyDatetimeCode=false&serverTimezone=UTC spring.datasource.usern

我正在尝试将我的spring boot应用程序连接到MYSQL workbench,但在MYSQL workbench中找不到我的任何列

我的设置: 此application.properties文件

spring.datasource.url=jdbc:mysql://localhost:3306/blog?useUnicode=true&useLegacyDatetimeCode=false&serverTimezone=UTC
spring.datasource.username=root
spring.datasource.password=
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.jpa.hibernate.ddl-auto=create-drop
spring.jpa.show-sql=true
当我尝试不使用“?useUnicode=true&useLegacyDatetimeCode=false&serverTimezone=UTC”时,会出现以下错误

HHH000342: Could not obtain connection to query metadata : The server time zone value 'EDT' 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.
我的Maven依赖项

<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.3.0.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.blogportfolio</groupId>
    <artifactId>blog</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>Bala's Blog</name>
    <description>Blog portfolio backend</description>

    <properties>
        <java.version>1.8</java.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.junit.vintage</groupId>
                    <artifactId>junit-vintage-engine</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
当我转到工作台时,博客模式是空的。

据我所知,它与您要使用的架构/表无关,而更像是一个服务器配置问题。根据所用驱动程序的特定版本,必须设置此属性

为了完成所需表的自动创建,可能会有所帮助

如果在应用程序运行时创建已经成功,只需将
ddl auto
参数从

spring.jpa.hibernate.ddl-auto=create-drop

创建后,更改为
验证
更新


可以找到进一步的解释。

据我所知,它与您要使用的架构/表无关,但更多的是服务器配置问题。根据所用驱动程序的特定版本,必须设置此属性

为了完成所需表的自动创建,可能会有所帮助

如果在应用程序运行时创建已经成功,只需将
ddl auto
参数从

spring.jpa.hibernate.ddl-auto=create-drop

创建后,更改为
验证
更新


可以找到进一步的解释。

您的
文章
实体的身份生成策略是
GenerationType.SEQUENCE
。但是
MySQL
不直接支持
Sequence

这就是为什么当
spring.jpa.hibernate.ddl auto=create drop
尝试创建模式时if失败的原因


GenerationType.IDENTITY一起使用
Article
实体的身份生成策略是
GenerationType.SEQUENCE
。但是
MySQL
不直接支持
Sequence

这就是为什么当
spring.jpa.hibernate.ddl auto=create drop
尝试创建模式时if失败的原因


使用
GenerationType.IDENTITY

你好,Ben,我用我的Maven依赖项更新了我的问题。我应该换哪一个然后再试一次?谢谢你的帮助。我想你必须回到一些版本。我建议您坚持使用最新版本,并添加符合您设置的所需时区的属性。啊,我想我刚刚了解了您的问题。尝试将属性添加到jdbc连接字符串中,启动应用程序,当它运行时,您可以在workbench中检查它吗?如果它不工作,您应该检查这一点:如果您看到预期的表:将
spring.jpa.hibernate.ddl auto=create drop
更改为
spring.jpa.hibernate.ddl auto=create
,一旦创建了
validate
或updateHi Ben,我就用我的Maven依赖项更新了我的问题。我应该换哪一个然后再试一次?谢谢你的帮助。我想你必须回到一些版本。我建议您坚持使用最新版本,并添加符合您设置的所需时区的属性。啊,我想我刚刚了解了您的问题。尝试将属性添加到jdbc连接字符串中,启动应用程序,当它运行时,您可以在workbench中检查它吗?如果它不工作,您应该检查这一点:如果您看到预期的表:将
spring.jpa.hibernate.ddl auto=create drop
更改为
spring.jpa.hibernate.ddl auto=create
,并在创建后更改为
validate
或update
spring.jpa.hibernate.ddl-auto=create