无法设置derby和server为mysql的客户端
C:\ symmetric-ds-3.0.1-server \ symmetric-ds-3.0.1 \ samples> .. \ bin \ dbimport --engine client1 --format XML create_sample.xml 日志输出将写入../logs/symmetric.log [] - AbstractCommandLauncher - 选项:name = engine,value = {client1} [] - AbstractCommandLauncher - 选项:name = format,value = {XML} [client1] - DerbySymmetricDialect - 正在使用的DbDialect是org.jumpmind.sym metric.db.derby.DerbySymmetricDialect [client1] - ExtensionPointManager - 找到2个将要注册的扩展点 ERED [client1] - JdbcSqlTemplate - 表/视图'item_selling_price'已存在于 Schema'SYMMETRIC'..无法执行:CREATE TABLE“item_selling_price” ( “price_id”INTEGER NOT NULL, “price”DECIMAL(10,2)NOT NULL, “成本”DECIMAL(10,2), PRIMARY KEY(“price_id”) )。 [client1] - JdbcSqlTemplate - 表/视图'item'已存在于Schema的SYMMET中 RIC'..执行失败:CREATE TABLE“item” ( “item_id”INTEGER NOT NULL, “price_id”INTEGER NOT NULL, “name”VARCHAR(100), PRIMARY KEY(“item_id”) )。 [client1] - JdbcSqlTemplate - 表/视图'sale_transaction'已存在于Sc中 hema'SYMMETRIC'..执行失败:CREATE TABLE“sale_transaction” ( “tran_id”INTEGER NOT NULL, “store”VARCHAR(5)NOT NULL, “workstation”VARCHAR(3)NOT NULL, “day”VARCHAR(10)NOT NULL, “seq”INTEGER NOT NULL, 主键(“tran_id”) )。 [client1] - JdbcSqlTemplate - 表/视图'sale_return_line_item'已经存在 在Schema'SYMMETRIC'中..无法执行:CREATE TABLE“sale_return_line_item”
(
"tran_id" INTEGER NOT NULL,
"item_id" INTEGER NOT NULL,
"price" DECIMAL(10,2) NOT NULL,
"quantity" INTEGER NOT NULL,
"returned_quantity" INTEGER,
PRIMARY KEY ("tran_id")
).
[client1] - JdbcSqlTemplate - Table/View 'sale_tender_line_item' already exists
in Schema 'SYMMETRIC'.. Failed to execute: CREATE TABLE "sale_tender_line_item"
(
"tran_id" INTEGER NOT NULL,
"tender_type" VARCHAR(254) NOT NULL,
"tender_amount" DECIMAL(10,2) NOT NULL,
"account_number" VARCHAR(255) NOT NULL,
PRIMARY KEY ("tran_id")
).
[client1] - JdbcSqlTemplate - Constraint 'fk_item_price_id' already exists in Sc
hema 'SYMMETRIC'.. Failed to execute: ALTER TABLE "item"
ADD CONSTRAINT "fk_item_price_id" FOREIGN KEY ("price_id") REFERENCES "item_sell
ing_price" ("price_id").
[client1] - JdbcSqlTemplate - Constraint 'fk_srli_tran_id' already exists in Sch
ema 'SYMMETRIC'.. Failed to execute: ALTER TABLE "sale_return_line_item"
ADD CONSTRAINT "fk_srli_tran_id" FOREIGN KEY ("tran_id") REFERENCES "sale_transa
ction" ("tran_id").
[client1] - JdbcSqlTemplate - Constraint 'fk_srli_item_id' already exists in Sch
ema 'SYMMETRIC'.. Failed to execute: ALTER TABLE "sale_return_line_item"
ADD CONSTRAINT "fk_srli_item_id" FOREIGN KEY ("item_id") REFERENCES "item" ("ite
m_id").
[client1] - JdbcSqlTemplate - Constraint 'fk_tndr_tran_id' already exists in Sch
ema 'SYMMETRIC'.. Failed to execute: ALTER TABLE "sale_tender_line_item"
ADD CONSTRAINT "fk_tndr_tran_id" FOREIGN KEY ("tran_id") REFERENCES "sale_transa
ction" ("tran_id").
C:\symmetric-ds-3.0.1-server\symmetric-ds-3.0.1\samples>
答案 0 :(得分:1)
看起来您正在尝试创建属于SymmetricDS Tutorial的示例表,并且这些表已存在于数据库中。您可能会运行该命令两次而不是一次。第一次运行它时,它会创建所有表。第二次运行它时,它会抱怨表已经存在。
我刚刚使用SymmetricDS 3.0.10完成了教程,我得到了示例数据库,用于在Apache Derby 10.5.3.0_1和MySQL 5.5.25a之间进行复制。我注意到的一件事是我需要指定属性文件,如下所示:
.. \ bin \ dbimport --engine client1 --format XML - properties client.properties create_sample.xml
如果没有指定属性文件,我以为我是在客户端上创建表,但它仍然使用服务器的属性文件,这给了我同样的错误。