【问题标题】:Liquibase failing while attempting to drop non-existent TMP_% tables during generateChangeLog在 generateChangeLog 期间尝试删除不存在的 TMP_% 表时 Liquibase 失败
【发布时间】:2019-10-03 01:43:51
【问题描述】:

跑步

liquibase generateChangeLog > genChgLog.txt

将以下内容作为我的 liquibase.properties,

类路径=C:\Program Files (x86)\MySQL\MySQL 连接器 J\mysql-connector-java-8.0.16.jar 驱动程序=com.mysql.cj.jdbc.Driver url=jdbc:mysql://{这不是问题,保证} 用户名={没错} 密码={没错} referenceUrl=jdbc:mysql://{这不是问题,保证} 参考用户名={没错} referencePassword={没错} changeLogFile=databaseChangeLogSchema.mysql.sql diffTypes=表、列、视图、主键、索引、外键、序列、数据 logLevel=调试

我一直得到这样的结果,输出到 genChgLog.txt 文件:

在 2019 年 5 月 15 日星期三 15:37:32 CDT 开始 Liquibase(版本 3.6.3 建于 2019-01-29 11:34:48) 运行 Liquibase 时出现意外错误: liquibase.exception.DatabaseException: liquibase.exception.DatabaseException:未知表 'TMP_CTAWHBNCQVQMHSUU' [失败的 SQL:删除表 TMP_CTAWHBNCQVQMHSUU] liquibase.exception.LiquibaseException: liquibase.command.CommandExecutionException: liquibase.exception.DatabaseException: liquibase.exception.DatabaseException:未知表 'TMP_CTAWHBNCQVQMHSUU' [失败的 SQL:删除表 TMP_CTAWHBNCQVQMHSUU] 在 liquibase.integration.commandline.CommandLineUtils.doGenerateChangeLog(CommandLineUtils.java:279) 在 liquibase.integration.commandline.Main.doMigration(Main.java:1058) 在 liquibase.integration.commandline.Main.run(Main.java:199) 在 liquibase.integration.commandline.Main.main(Main.java:137) 原因: liquibase.command.CommandExecutionException: liquibase.exception.DatabaseException: liquibase.exception.DatabaseException:未知表 'TMP_CTAWHBNCQVQMHSUU' [失败的 SQL:删除表 TMP_CTAWHBNCQVQMHSUU] 在 liquibase.command.AbstractCommand.execute(AbstractCommand.java:24) 在 liquibase.integration.commandline.CommandLineUtils.doGenerateChangeLog(CommandLineUtils.java:277) ...省略了3个常见的框架原因: liquibase.exception.DatabaseException: liquibase.exception.DatabaseException:未知表 'TMP_CTAWHBNCQVQMHSUU' [失败的 SQL:删除表 TMP_CTAWHBNCQVQMHSUU] 在 liquibase.snapshot.jvm.ForeignKeySnapshotGenerator.snapshotObject(ForeignKeySnapshotGenerator.java:223) 在 liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:66) . . .在 liquibase.command.core.GenerateChangeLogCommand.run(GenerateChangeLogCommand.java:46) 在 liquibase.command.AbstractCommand.execute(AbstractCommand.java:19) ...省略了4个常见的框架原因: liquibase.exception.DatabaseException:未知表 'TMP_CTAWHBNCQVQMHSUU' [失败的 SQL:删除表 TMP_CTAWHBNCQVQMHSUU] 在 liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:356) 在 liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:57) 在 liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:125) 在 liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:109) 在 liquibase.database.core.MySQLDatabase.hasBugJdbcConstraintsDeferrable(MySQLDatabase.java:294) 在 liquibase.snapshot.jvm.ForeignKeySnapshotGenerator.snapshotObject(ForeignKeySnapshotGenerator.java:188) ... 省略了 25 个常见帧 原因: java.sql.SQLSyntaxErrorException:未知表 'TMP_CTAWHBNCQVQMHSUU' 在 com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120) 在 com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) 在 com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) 在 com.mysql.cj.jdbc.StatementImpl.executeInternal(StatementImpl.java:782) 在 com.mysql.cj.jdbc.StatementImpl.execute(StatementImpl.java:666) 在 liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:352) ...省略了30个常用框架

有关更多信息,请使用 --logLevel 标志

每次我运行它时,它都会更改虚拟 TMP_ 表的名称(尽管它们总是以 TMP_ 开头,然后是一串明显随机的字符)。我不知道它从哪里得到这些不存在的 TMP_ 表,它想要删除,但是......有没有办法让它只在它们存在时尝试删除它们?潜在的注意事项:如果我唯一的 diffType 是“tables”、“data”,或者如果我同时拥有“tables”和“data”作为 diffTypes,它就可以正常工作......否则,失败......

【问题讨论】:

    标签: liquibase


    【解决方案1】:

    我没有所有详细信息,但似乎在使用权限不足的数据库用户时可能会发生这种情况。我与某人交谈过,他说使用根级数据库用户为他们解决了这个问题。

    【讨论】:

      猜你喜欢
      • 2014-08-29
      • 2013-09-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-24
      • 1970-01-01
      相关资源
      最近更新 更多