Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you connect to a MySQL database using Oracle SQL Developer?

I have Oracle SQL Developer already installed and am able to connect to and query Oracle databases.

Using Help -> Check for Updates I was able to install the Oracle MySQL Browser extension but there are no connection options for MySQL databases.

like image 306
Craig Hyatt Avatar asked Sep 18 '08 03:09

Craig Hyatt


People also ask

Can we connect MySQL database in Oracle SQL Developer?

Open SQL Developer and navigate to "Tools > Preferences > Database > Third Party JDBC Driver". Click the "Add Entry..." button and highlight the "mysql-connector-java-8.0. 23. jar" file and click the "Select" button.


5 Answers

Under Tools > Preferences > Databases there is a third party JDBC driver path that must be setup. Once the driver path is setup a separate 'MySQL' tab should appear on the New Connections dialog.

Note: This is the same jdbc connector that is available as a JAR download from the MySQL website.

like image 58
Brian Avatar answered Oct 05 '22 16:10

Brian


In fact you should do both :


  1. Add driver

    • Download driver https://maven.atlassian.com/content/groups/public/mysql/mysql-connector-java/5.1.29/
    • To add this driver :
    • In Oracle SQL Developper > Tools > Preferences... > Database > Third Party JDBC Drivers > Add Entry...
    • Select previously downloaded mysql connector jar file.
  2. Add Oracle SQL developper connector

    • In Oracle SQL Developper > Help > Check for updates > Next
    • Check All > Next
    • Filter on "mysql"
    • Check All > Finish
  3. Next time you will add a connection, MySQL new tab is available !

like image 37
jurevert Avatar answered Oct 05 '22 16:10

jurevert


Here's another extremely detailed walkthrough that also shows you the entire process, including what values to put in the connection dialogue after the JDBC driver is installed: http://rpbouman.blogspot.com/2007/01/oracle-sql-developer-11-supports-mysql.html

like image 28
derekdac Avatar answered Oct 05 '22 17:10

derekdac


My experience with windows client and linux/mysql server:

When sqldev is used in a windows client and mysql is installed in a linux server meaning, sqldev network access to mysql.

Assuming mysql is already up and running and the databases to be accessed are up and functional:

• Ensure the version of sqldev (32 or 64). If 64 and to avoid dealing with path access copy a valid 64 version of msvcr100.dll into directory ~\sqldeveloper\jdev\bin.

a. Open the file msvcr100.dll in notepad and search for first occurrence of “PE “

 i. “PE  d” it is 64.

ii. “PE  L” it is 32.

b. Note: if sqldev is 64 and msvcr100.dll is 32, the application gets stuck at startup.

• For sqldev to work with mysql there is need of the JDBC jar driver. Download it from mysql site.

a. Driver name = mysql-connector-java-x.x.xx

b. Copy it into someplace related to your sqldeveloper directory.

c. Set it up in menu sqldev Tools/Preferences/Database/Third Party JDBC Driver (add entry)

• In Linux/mysql server change file /etc/mysql/mysql.conf.d/mysqld.cnf look for

bind-address = 127.0.0.1 (this linux localhost)

and change to

bind-address = xxx.xxx.xxx.xxx (this linux server real IP or machine name if DNS is up)

• Enter to linux mysql and grant needed access for example

# mysql –u root -p

GRANT ALL ON . to root@'yourWindowsClientComputerName' IDENTIFIED BY 'mysqlPasswd';

flush privileges;

restart mysql - sudo /etc/init.d/mysql restart

• Start sqldev and create a new connection

a. user = root

b. pass = (your mysql pass)

c. Choose MySql tab

 i.   Hostname = the linux IP hostname

 ii.  Port     = 3306 (default for mysql)

 iii. Choose Database = (from pull down the mysql database you want to use)

 iv.  save and connect

That is all I had to do in my case.

Thank you,

Ale

like image 36
Ale Avatar answered Oct 05 '22 15:10

Ale


Although @BrianHart 's answer is correct, if you are connecting from a remote host, you'll also need to allow remote hosts to connect to the MySQL/MariaDB database.

My article describes the full instructions to connect to a MySQL/MariaDB database in Oracle SQL Developer:

https://alvinbunk.wordpress.com/2017/06/29/using-oracle-sql-developer-to-connect-to-mysqlmariadb-databases/

like image 40
Alvin Bunk Avatar answered Oct 05 '22 16:10

Alvin Bunk