java - Spring boot参数更新模型数据库不起作用
问题描述
我将值设置为更新值,以便在数据库中创建一个表,自动对应于定义的数据模型。但它不起作用,我的属性有什么问题?数据库: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
与“spring.jpa.hibernate.ddl-auto=update”发生了什么冲突
解决方案
确保数据库连接字符串有效。尝试改变spring.datasource.url=jdbc:mysql://localhost:3306/test?useSSL=false&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=UTC
您的数据库的名称是“测试”,但它是真的吗?
推荐阅读
- python-3.x - 验证非静态参数 (webargs/marshmallow)
- fiware-orion - 无法运行 Orion 上下文代理
- javascript - React - 在子节点加载时显示加载器
- node.js - create-react-native-app app-name 不能正常工作
- sql-server - 需要查询这个
- ubuntu - 关于 ubuntu 服务器的 ubuntu 虚拟桌面 18.04 上的空白页和错误 500
- jquery - Bootstrap 4 灵活的响应式导航栏菜单
- api - OneDrive Microsoft Graph 错误:令牌包含无效签名
- java - Java 10 和 liquibase-maven-plugin 更新未找到 java/sql/Driver
- ios - Mapbox 加载样式失败:HTTP 状态码 401