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

后端 未结 6 518
暗喜
暗喜 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: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

提交回复
热议问题