I have a working MySQL 8.x configuration that I'd like to pass along.
First, there are a few important MySQL configuration options we need to be aware of.
A default MySQL 8.x server configuration will accept, but not force, an SSL client connection. So unless your MySQL 5.x or 8.x server configuration has been altered to force an SSL connection, no additional parameters are required to connect.
More info here:
MySQL 8.x SSL Connections
MySQL 8.x has updated the default behavior of DATETIME and TIMESTAMP.
I was able to maintain compatibility with my database by including the "zeroDateTimeBehavior=convertToNull" connection option. YMMV.
More info here:
Datetime and Timestamp Changes
MySQL 8.x requires that you have a timezone configured (not sure about 5.x). I chose to define a timezone in my connection parameters rather than in my server config ("serverTimezone=UTC")
Second: where to place an updated MySQL connector jar file? Essentially, it does not matter where you place the updated jar file, as long as you include the file in your ClassPath. In my example I left the 8.x connector jar file in the directory the installer chose. I just passed the information along using "AddToClassPath". You could also place the updated connector jar file in any folder already included in Mathematica's default ClassPath, as found using "JavaClassPath[]".
Third: change "com.mysql.jdbc.Driver" to "com.mysql.cj.jdbc.Driver" as the MySQL 8.x connector has been updated and packaged slightly different than the 5.x versions.
The following connection works for me:
Needs["JLink`"];
AddToClassPath[FileNameJoin[{"/usr/share/java/mysql-connector-java.jar"}]];
JavaClassPath[]
Needs["DatabaseLink`"];
ShowJavaConsole[];
conn = OpenSQLConnection[JDBC["com.mysql.cj.jdbc.Driver","jdbc:mysql://localhost:3306/test?serverTimezone=UTC&zeroDateTimeBehavior=convertToNull"],"Username" -> "user","Password" -> "abcdefg", "ReadOnly" -> True]
$UserBaseDirectory/Applications/Oracle/
with success. I put the jar into$UserBaseDirectory/Applications/Oracle/Java
and theJDBCDriver
configuration .m file into$UserBaseDirectory/Applications/Oracle/DatabaseResources
. $\endgroup$