2014-06-18 65 views
0

Java應用程序如何連接到多主複製MySQL數據庫?多主複製

我使用com.mysql.jdbc.ReplicationDriver

但這是給異常爲:

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure 
+0

請仔細閱讀本本教程中,我希望它能幫助: http://stackoverflow.com/questions/2983248/com-mysql-jdbc-exceptions-jdbc4-communicationsexception -communication-link-fai – SaintLike

+0

我的JDBC URL是String JDBC_URL =「jdbc:mysql:replication:// address =(host = localhost)(port = 3308)( type = master),「 \t \t \t +」address =(host = localhost)(port = 3306)(type = master)「; – Dev

+0

這是隻有多個貼圖...在一臺機器上(localhost) – Dev

回答

0

你看了我給你發你的問題的意見線程?沒有幫助?嘗試創建一個一步一步的MySQL + JDBC教程

Tutorial

我希望它能幫助