简体   繁体   English

MySQL架构不断删除表而不采取措施

[英]Mysql schema keeps dropping tables without action

Every time i relog to mysqlworkbench the tables that i have created within my schema have been automatically dropped. 每次我重新登录到mysqlworkbench时,我在架构中创建的表都会自动删除。 This happens after about 2 hours every time. 每次大约2个小时后就会发生这种情况。 I can't quite figure out if this is some mysql setting or if I have incorrectly configured the database. 我不太确定这是某些mysql设置还是我错误地配置了数据库。

在此处输入图片说明

I'm accessing the database via java spring-data persistence jpa requests. 我正在通过java spring-data persistence jpa请求访问数据库。

sql table entry code: sql表的输入代码:

 use storage_app_schema;
CREATE TABLE `StorageItem` (
`DateStored` tinyblob,
`Image` tinyblob,
`Name` varchar(255) DEFAULT NULL,
`ReferenceCode` varchar(255) DEFAULT NULL,
`Size` varchar(255) DEFAULT NULL)

hibernate.hbm2ddl.auto was set to "create". hibernate.hbm2ddl.auto设置为“创建”。 I wasn't aware this dropped existing table. 我不知道这删除了现有表。 This should be set to "update" - in order to update the existing schema as opposed to overriding it when the session closes. 应将其设置为“ update”-为了更新现有架构,而不是在会话关闭时覆盖现有架构。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM