symmetricds

How to change locate service (sym_%) tables to another database


I have several database: syncdb (for replication) and servicedb (for SymmetricDS tables)

Is it possible to store sym_% tables in another database?

Connection string:

db.url=jdbc:mysql://127.0.0.1:3306/servicedb

Trigger row:

INSERT INTO servicedb.sym_trigger (trigger_id,source_catalog_name,source_table_name,channel_id,create_time,last_update_time)
VALUES ('trigger_sync_table','syncdb','sync_table','channel_dbc',NOW(),NOW());

When I run bin/sym I get an error:

TriggerRouterService - Could not find any database tables matching 'syncdb.sync_table' in the datasource that is configured


Solution

  • Yes, it is possible to put Symmetric's tables in a separate database to your application tables. You specified the source_catalog_name, so your sym_trigger entry is correct.

    You need to grant the following permissions to your db.user to allow access to the tables in the syncdb database. Replace "symmetric" with the value of your db.user property.

    grant trigger on *.* to symmetric;
    grant create routine on *.* to symmetric;
    grant alter routine on *.* to symmetric;
    grant process on *.* to symmetric;