简体   繁体   English

Spring 启动参数更新 model 数据库不工作

[英]Spring boot parameter update model Database don't work

i set the value to update value so that a table will be created in the database automatically corresponding to defined data model.我将值设置为更新值,以便在数据库中创建一个表,自动对应于定义的数据 model。 But it does not work, what it wrong with my properties?但它不起作用,我的属性有什么问题? Database: Mysql数据库:Mysql

spring.jpa.hibernate.naming.implicit-strategy=org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyJpaImpl
spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl

spring.servlet.multipart.max-file-size=2MB
spring.servlet.multipart.max-request-size=2MB


server.port=8081
server.servlet.session.timeout=1200
spring.datasource.url=jdbc:mysql://localhost:3306/test?useSSL=false&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=UTC
spring.datasource.username= root
spring.datasource.password=
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.jpa.show-sql=true
spring.jpa.hibernate.ddl-auto=update

spring.jpa.properties.hibernate.dialect= org.hibernate.dialect.MySQL5InnoDBDialect

spring.jpa.database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
spring.jpa.properties.hibernate.storage.storage_engine=innodb

spring.security.user.name="root"
spring.security.user.password="123"
spring.resources.add-mappings=true
java.sql.SQLSyntaxErrorException: Table 'test.files' doesn't exist

What genereted conflict with "spring.jpa.hibernate.ddl-auto=update"与“spring.jpa.hibernate.ddl-auto=update”发生了什么冲突

Make sure the database connection string is valid.确保数据库连接字符串有效。 Try changing spring.datasource.url=jdbc:mysql://localhost:3306/test?useSSL=false&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=UTC尝试更改spring.datasource.url=jdbc:mysql://localhost:3306/test?useSSL=false&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=UTC

The name of your database is "test" but is it really?您的数据库的名称是“测试”,但它是真的吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 春季启动不适用于数据库 - Spring-boot don't work with database 春季启动:@GetMapping与Pageable作为请求参数无法正常工作 - Spring Boot: @GetMapping with Pageable as request parameter don't work as expected Spring Boot的日期格式不起作用 - Date format with Spring Boot don`t work Mongo 可审计的 ZonedDateTime 字段在 Spring Boot 2 中不起作用 - Mongo auditable ZonedDateTime fields don't work in Spring Boot 2 @ConfigurationProperties 在 Spring Boot 2.4.2 的测试中不起作用 - @ConfigurationProperties don't work in test in Spring Boot 2.4.2 @NotNull 约束不适用于应用程序属性值 spring 启动 - @NotNull constraint don't work for a application property value spring boot ModelMapper和DozerBeanMapper无法正常工作 Spring Boot REST API - ModelMapper and DozerBeanMapper don't work | Spring Boot REST API Spring Boot + Hibernate + Flyway:不要在新数据库上运行迁移 - Spring Boot + Hibernate + Flyway: don't run migrations on new database spring-boot-starter-web 和 spring-boot-starter-webflux 不能一起工作吗? - Don't spring-boot-starter-web and spring-boot-starter-webflux work together? Spring Boot数据源数据库连接配置不起作用 - Spring Boot datasource database connection config doesn't work
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM