gpt4 book ai didi

mysql - Liquibase:无法将数据提取到变更日志文件

转载 作者:行者123 更新时间:2023-11-30 01:20:55 25 4
gpt4 key购买 nike

我确信这对于经验丰富的 Liquibase 用户来说似乎是显而易见的。我想将数据从简单的两个表数据库提取到 xml 文件。我正在运行的命令是:

java -cp "liquibase.jar;mysql-connector-java/*" "liquibase.integration.commandline.Main" --driver=com.mysql.jdbc.Driver --url=jdbc:mysql://localhost:3306/dti_subcat_mappings --username=myusername --password=mypassword --changeLogFile="C:\temp\category_data.xml" --diffTypes="data" generateChangeLog

运行此命令会生成一个基本上空的 xml 文件:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd"/>

命令输出为:

INFO 8/31/13 8:57 PM:liquibase: Reading tables for root@localhost @ jdbc:mysql://localhost:3306/dti_subcat_mappings ...
INFO 8/31/13 8:57 PM:liquibase: Reading views for root@localhost @ jdbc:mysql://localhost:3306/dti_subcat_mappings ...
INFO 8/31/13 8:57 PM:liquibase: Reading foreign keys for root@localhost @ jdbc:mysql://localhost:3306/dti_subcat_mappings ...
INFO 8/31/13 8:57 PM:liquibase: Reading primary keys for root@localhost @ jdbc:mysql://localhost:3306/dti_subcat_mappings ...
INFO 8/31/13 8:57 PM:liquibase: Reading columns for root@localhost @ jdbc:mysql://localhost:3306/dti_subcat_mappings ...
INFO 8/31/13 8:57 PM:liquibase: Reading unique constraints for root@localhost @ jdbc:mysql://localhost:3306/dti_subcat_mappings ...
INFO 8/31/13 8:57 PM:liquibase: Reading indexes for root@localhost @ jdbc:mysql://localhost:3306/dti_subcat_mappings ...
INFO 8/31/13 8:57 PM:liquibase: Sequences not supported for root@localhost @ jdbc:mysql://localhost:3306/dti_subcat_mappings ...
INFO 8/31/13 8:57 PM:liquibase: C:\temp\category_data.xml exists, appending
INFO 8/31/13 8:57 PM:liquibase: No changes found, nothing to do
Liquibase 'generateChangeLog' Successful

最佳答案

以下 H2 数据库示例适合我:

$ java -cp liquibase-core-3.0.3.jar:h2-1.3.173.jar:snakeyaml-1.12.jar \
liquibase.integration.commandline.Main \
--url=jdbc:h2:db/scottTiger \
--driver=org.h2.Driver \
--username=user \
--password=pass \
--changeLogFile=data.xml \
--diffTypes=data \
generateChangeLog
INFO 01/09/13 09:17:liquibase: data.xml does not exist, creating
Liquibase 'generateChangeLog' Successful

几个问题:

  • 您似乎使用的是 2.0 版(变更集声明)。您是否尝试过升级到3.0?
  • 您确定连接到正确的架构吗?

关于mysql - Liquibase:无法将数据提取到变更日志文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18553985/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com