Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Not a Bug
-
2.6.2
-
None
-
Aurora mysql 2.07.2
Java 8 (1.8.0_191-b12)
Mariadb driver 2.6.2 (mariadb-java-cleint-2.6.2.jar)
Description
When I connect to Aurora Mysql 2.07.2 using route53 cname, error occurred.
In 2.04.8 of Aurora Mysql, there is no problem to connect to DB using Route 53 cname.
However, after upgrade to 2.07.2, slave node can't be connected.
I made simple java code like this. (It is not easy to read and I attached the source code file to this issue.)
import java.sql.*;
public class mysqlconn2 {
static final String JDBC_DRIVER = "org.mariadb.jdbc.Driver";
static final String DB_URL = "jdbc:mysql://slavedb.hhs.local:3306/board";
static final String USERNAME = "dbadmin"; static final String PASSWORD = "123456";
public static void main(String[] args) {
Connection conn = null; Statement stmt = null;
try{ //Class.forName(JDBC_DRIVER);
Class.forName("org.mariadb.jdbc.Driver");
conn = DriverManager.getConnection(DB_URL,USERNAME,PASSWORD);
System.out.println("\n- MySQL Connection");
stmt = conn.createStatement();
String sql;
sql = "SELECT * FROM board";
ResultSet rs = stmt.executeQuery(sql);
.... (I attached whole source code to this issue.)
---execution error is like this.
java.sql.SQLNonTransientConnectionException: Could not connect to address=(host=slavedb.hhs.local)(port=3306)(type=master) : (conn=816) could not load system variables at org.mariadb.jdbc.internal.util.exceptions.ExceptionFactory.createException(ExceptionFactory.java:73) at org.mariadb.jdbc.internal.util.exceptions.ExceptionFactory.create(ExceptionFactory.java:192) at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.connectWithoutProxy(AbstractConnectProtocol.java:1372) at org.mariadb.jdbc.internal.util.Utils.retrieveProxy(Utils.java:635) at org.mariadb.jdbc.MariaDbConnection.newConnection(MariaDbConnection.java:150) at org.mariadb.jdbc.Driver.connect(Driver.java:89) at java.sql.DriverManager.getConnection(DriverManager.java:664) at java.sql.DriverManager.getConnection(DriverManager.java:247) at mysqlconn2.main(mysqlconn2.java:17)Caused by: java.sql.SQLNonTransientConnectionException: (conn=816) could not load system variables at org.mariadb.jdbc.internal.util.exceptions.ExceptionFactory.createException(ExceptionFactory.java:73) at org.mariadb.jdbc.internal.util.exceptions.ExceptionFactory.create(ExceptionFactory.java:183) at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.requestSessionDataWithShow(AbstractConnectProtocol.java:1093) at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.additionalData(AbstractConnectProtocol.java:1106) at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.postConnectionQueries(AbstractConnectProtocol.java:880) at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.createConnection(AbstractConnectProtocol.java:588) at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.connectWithoutProxy(AbstractConnectProtocol.java:1367) ... 6 moreCaused by: java.sql.SQLNonTransientConnectionException: (conn=816) Connection is closed at org.mariadb.jdbc.internal.util.exceptions.ExceptionFactory.createException(ExceptionFactory.java:73) at org.mariadb.jdbc.internal.util.exceptions.ExceptionFactory.create(ExceptionFactory.java:187) at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.cmdPrologue(AbstractQueryProtocol.java:1940) at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.executeQuery(AbstractQueryProtocol.java:249) at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.requestSessionDataWithShow(AbstractConnectProtocol.java:1068) ... 10 more
I tried to use aurora option and result is also same:error.But replication option worked, but slow.
jdbc:mysql:aurora://slavedb.hhs.local:3306/board -> fail
jdbc:mysql:replication://slavedb.hhs.local:3306/board -> success , but slow.
(masterdb.hhs.local don't have problem to connect
I matched Route 53 cname with cluster endpoints of DB.
masterdb.hhs.local -> up-version-2-07-2.cluster-xxxxxxxxxxx.ap-northeast-2.rds.amazonaws.com
slavedb.hhs.lcao ->up-version-2-07-2.cluster-ro-xxxxxxxxxxx.ap-northeast-2.rds.amazonaws.com
)
In 2.04.8 of Aurora DB, there is no problem connecting to db with this url.
jdbc:mysql://slavedb.hhs.local:3306/board
I guess this problem is caused by that maria driver can't support the recent version of aurora mysql (over 2.04.8).
Can you check this problem please?
Thank you very much
Today, I compiled source of maria 2.6.2 connector/j and tried to find when this error occurred.
In the Results.java, executionResults value is null!
public boolean commandEnd() {
if (cmdInformation != null) {
System.out.println("\n test " + executionResults); //test!!
if (executionResults != null && !cmdInformation.isCurrentUpdateCount())
else
cmdInformation.setRewrite(rewritten);
} else
return cmdInformation != null;
}
Best Regards,
Heungsu