Connecting MySQL Using Oracle SQL Developer

This article explains how to configure Oracle SQL Developer to connect to MySQL.

  1. Download SQL Developer from Oracle website.

https://www.oracle.com/ca-en/tools/downloads/sqldev-v192-downloads.html

SQLD_1

Once you download the rpm package, Install it using the below commands.

SQLDeveloper_1

2.  Download latest MySQL Connector (https://dev.mysql.com/downloads/connector/j/) and move it to SQL Developer directory.

Make sure you download “Platform Independent” version.

Screenshot from 2020-03-17 14-00-35

3. Now you have to make MySQL aware of this third party connector.

Navigate to “Tools > Preferences > Database > Third Party JDBC Driver” and Click the “Add Entry…” button and highlight the “mysql-connector-java-8.0.19-bin.jar” file and click the “Select” button. Then click the “Ok” button to close the window.

SQD_2

4. Open the New Connection window and create a new Database Connection.

SQD_3

4. Now you will find a new value in the “Database Type” drop down, select MySQL and enter your credentials and database details. Please note that the hostname and port number might be different for your environment.

SQD5

5. Try to test the connection and if that is successful click on “Connect”.

6. You will land the SQL Developer Home Screen and will be able to query the MySQL database just like you query Oracle.

SQD_6SQD_7

I haven’t explored all the features available for MySQL connection. You can do all that yourself.

PS: In case you face the JDBC timezone error you can fix that by running the following MySQL commands (Please check with your DBA before you run it against any of your company MySQL databases)

Status : Failure -Test failed: The server time zone value ‘EDT’ is unrecognized or represents more than one time zone.
You must configure either the server or JDBC driver (via the ‘serverTimezone’ configuration property) to use a more specific time zone value if you want to utilize time zone support.

SET @@global.time_zone = '+00:00';
SET @@session.time_zone = '+00:00';

With the following SQL statements check if the values were set:

SELECT @@global.time_zone, @@session.time_zone;

Hope this helps..

One thought on “Connecting MySQL Using Oracle SQL Developer

Leave a comment