Bug #65365 ReplicationDriver can't connect to databases with different names
Submitted: 18 May 2012 17:52 Modified: 5 Jun 2012 9:59
Reporter: Tero Paananen Email Updates:
Status: Verified Impact on me:
None 
Category:Connector / J Severity:S4 (Feature request)
Version:8.0.x,5.1.x OS:Any
Assigned to: Assigned Account CPU Architecture:Any

[18 May 2012 17:52] Tero Paananen
Description:
If master/slave replication is set up with the replicate-rewrite-db option causing the slaves to have different database names than on the master, the ReplicationDriver can not be used to correctly connect to these renamed databases on the slaves.

jdbc:mysql:replication://master,slave1,slave2,slave3/test,test_renamed,test_renamed,test_renamed

or

jdbc:mysql:replication://address=(protocol=tcp)(host=master)(database=test),address=(protocol=tcp)(host=slave1)(database=test_renamed),address=(protocol=tcp)(host=slave2)(database=test_renamed),address=(protocol=tcp)(host=slave3)(database=test_renamed)

is not supported.

Therefore accessing a master/slave setup like this is not possible using the ReplicationDriver.

Is there a workaround beyond creating separate datasources in your application?

How to repeat:
Set up master/slave replication with the replicate-rewrite-db option and make sure the database being replicated is renamed on the slave.

Alternatively, for debugging purposes, create the identical databases on two servers, rename one of the databases.

Then try accessing the differently named databases with the ReplicationDriver.
[5 Jun 2012 9:59] Valeriy Kravchuk
Thank you for the feature request.