2
$\begingroup$

Struggling with OpenSQLConnect[Connector/J] in Mathematica version 13.0. The code is:

OpenSQLConnection[
 JDBC["MySQL(Connector/J)", "ip and name of remote database"], 
 "Version" -> 3.1, "Catalog" -> Automatic, "Description" -> None, 
 "autoReconnect" -> True, "Password" -> xxx", 
 "Properties" -> {}, "ReadOnly" -> Automatic, "RelativePath" -> False,
  "TransactionIsolationLevel" -> Automatic, 
 "UseConnectionPool" -> Automatic, "Username" -> "xxx", 
 "Timeout" -> 1000]

Getting:

*JDBC::error: Communications link failure The last packet successfully received from the server was 515 milliseconds ago. The last packet sent successfully to the server was 484 milliseconds ago.*

Curious thing:

Executing the same code, at the same time, on the same machine in version 12.3 is working well.

Conclusion: it is a bug in 13.0.

Command JDBCDrivers["MySQL(Connector/J)"] gives

JDBCDriver["Name" -> "MySQL(Connector/J)", 
 "Driver" -> "com.mysql.jdbc.Driver", 
 "Protocol" -> {"jdbc:mysql://", "jdbc:mysql:loadbalance://"}, 
 "Version" -> 3.1`, 
 "Description" -> "MySQL using Connector/J - Version 5.1.44", 
 "Location" -> 
  "C:\\Program Files\\Wolfram \
Research\\Mathematica\\12.3\\SystemFiles\\Links\\DatabaseLink\\
DatabaseResources\\mysql.m"]

the same as in version 13.0 (except the location)

JDBCDriver["Name" -> "MySQL(Connector/J)", 
 "Driver" -> "com.mysql.jdbc.Driver", 
 "Protocol" -> {"jdbc:mysql://", "jdbc:mysql:loadbalance://"}, 
 "Version" -> 3.1, 
 "Description" -> "MySQL using Connector/J - Version 5.1.44", 
 "Location" -> 
  "C:\\Program Files\\Wolfram \
Research\\Mathematica\\13.0\\SystemFiles\\Links\\DatabaseLink\\\
DatabaseResources\\mysql.m"]

The mysql.m packages are identical in both installations. Verified on another computer, same behavior: v12.3 works, v13.0 doesn't.

Did anybody encounter this? Maybe a solution?

Thanks, Laszlo

$\endgroup$
5
  • $\begingroup$ I've encountered this as well, works in multiple versions of 12 but not 13. Are you on 13.0.0 or 13.0.1? $\endgroup$
    – atlasgeo
    Apr 7, 2022 at 15:35
  • $\begingroup$ -I've updated to 13.0.1 and the problem persists. macOS 10.15.7 $\endgroup$
    – atlasgeo
    Apr 7, 2022 at 17:24
  • $\begingroup$ @atlasgeo Thanks for your reply. I have 13.0.0. Maybe we should fill a bug report? $\endgroup$
    – Laszlo
    Apr 7, 2022 at 18:19
  • $\begingroup$ Contacted Wolfram support and received a workaround. We must add Properties-> {useSSL-> False), to the command syntax. See below. $\endgroup$
    – Laszlo
    Apr 7, 2022 at 18:54
  • $\begingroup$ Thanks, I'd contacted them and referenced your post here, they redirected me back to this post for your answer lol. $\endgroup$
    – atlasgeo
    Apr 7, 2022 at 21:28

1 Answer 1

3
$\begingroup$

Wolfram support suggested this workaround. See Properties->

OpenSQLConnection[
 JDBC["MySQL(Connector/J)", "ip and name of remote database"], 
 "Version" -> 3.1, "Catalog" -> Automatic, "Description" -> None, 
 "autoReconnect" -> True, "Password" -> xxx", 
 "Properties" -> {"useSSL" -> "False"}, "ReadOnly" -> Automatic, "RelativePath" -> False,
  "TransactionIsolationLevel" -> Automatic, 
 "UseConnectionPool" -> Automatic, "Username" -> "xxx", 
 "Timeout" -> 1000]

It works! The developers will implement the useSSL->True in the next version.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.