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

后端 未结 6 467
暗喜
暗喜 2021-01-31 07:34

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 MySQ

相关标签:
6条回答
  • 2021-01-31 07:42

    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/

    0 讨论(0)
  • 2021-01-31 07:43

    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 !

    0 讨论(0)
  • 2021-01-31 07:44

    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

    0 讨论(0)
  • 2021-01-31 07:49

    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

    0 讨论(0)
  • 2021-01-31 07:54

    You may find the following relevant as well:

    Oracle SQL Developer connection to Microsoft SQL Server

    In my case I had to place the ntlmauth.dll in the sql-developer application directory itself (i.e. sql-developer\jdk\jre\bin). Why this location over the system jre/bin I have no idea. But it worked.

    0 讨论(0)
  • 2021-01-31 07:56

    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.

    0 讨论(0)
提交回复
热议问题