9 Replies Latest reply on Dec 24, 2014 6:21 PM by mxallen-Oracle

    oracle to mysql

    ora_learner36

      dear all,

                   i was connecting MYSQL database from oracle database.i got the following error ,shown below-

      ]$ ./isql myodbc5 -v

      [01000][unixODBC][Driver Manager]Can't open lib '/opt/oradb/patches/myodbc-5.3.4/lib/libmyodbc5.so' : file not found

      [ISQL]ERROR: Could not SQLConnect.

                      kindly help,your help will be appreciated thanks in advance.

       

      oracle db:11.2.0.3

      oracle os:rhel 6

      mysql db:5.6.19

      mysql os:win 7

       

      thanks and regards

        • 1. Re: oracle to mysql
          Mkirtley-Oracle

          Hi,

             As you are not using any Oracle software so far, technically you should open this in a MySQL forum.  However, to follow up -

           

          1. Have you checked the obvious ? Does the ODBC driver exist in the directory -

          /opt/oradb/patches/myodbc-5.3.4/lib/libmyodbc5.so

           

          2. Did you set any ENV variables before running ISQL ?  At a minimum you should set the LD_LIBRARY_PATH to include the path to the driver lib directory, and set the ODBCINI variable to the location of the odbc.ini file.


          export LD_LIBRARY_PATH=/opt/oradb/patches/myodbc-5.3.4/lib:$LD_LIBRARY_PATH

          export ODBCINI=<dir_location>/odbc.ini


          Once that works you should review the following note available in My Oracle Support for the Dg4ODBC configuration -


          How to Configure DG4ODBC on 64bit Unix OS (Linux, Solaris, AIX, HP-UX Itanium) to Connect to Non-Oracle Databases Post Install (Doc ID 561033.1)


          Regards,

          Mike

          • 2. Re: oracle to mysql
            ora_learner36

            thanks for replying,i will show the steps which i did on my oracle linux server.

            1. i checked for avaible unixodbc manager and mysql connector odbc

            ]$ rpm -qa unix*

            unixODBC-devel-2.2.14-11.el6.x86_64

            unixODBC-2.2.14-11.el6.x86_64

             

            ]$ rpm -qa mysql*

            mysql-5.1.52-1.el6_0.1.x86_64

            mysql-devel-5.1.52-1.el6_0.1.x86_64

            mysql-server-5.1.52-1.el6_0.1.x86_64

            mysql-connector-odbc-5.1.5r1144-7.el6.x86_64

            mysql-libs-5.1.52-1.el6_0.1.x86_64

             

            2) i downloaded unixODBC driver manager

             

            1. copy the unixODBC-2.3.2.tar.gz file somewhere you can create files and directories

            2. gunzip unixODBC*.tar.gz

            3. tar xvf unixODBC*.tar

            Make the Libraries and Programs

            The install uses the standard GNU autoconf process. So its simply a matter of running

            ./configure  --prefix=/opt/oradb/patches/unixODBC

            make

            make install

             

            3) i downloaded mysql connector odbc(i did not install it because already there in my machine)

            1.download mysql-connector-odbc-5.3.4-linux-el6-x86-64bit.tar.gz

            2.gunzip -c mysql-connector-odbc-5.3.4-linux-el6-x86-64bit.tar.gz | tar xvf -

            ]$ls /opt/oradb/patches/mysql connector/lib     (no file libmyodbc5.so)

            libmyodbc5a.so

            libmyodbc5s.so

            libmyodbc5w.so

             

            4)

            etc]$ cat odbc.ini

            [myodbc5]

            Description = ortomysql

            Driver      = /opt/oradb/patches/mysql connector/lib/libmyodbc5.so

            Server      = 192.168.0.21

            Database    =<dbname>

            LogonID     =root

            Password    =<pwd>

            Port        =3306

            Socket      =

            Option      =

            Stmt        =

             

            [ODBC Data Sources]

             

            5)

            ]$ cd /opt/oradb/patches/unixODBC/bin------------(unixODBC driver manager directory)

            ]$./isql myodbc5 -v


            [01000][unixODBC][Driver Manager]Can't open lib '/opt/oradb/patches/myodbc-5.3.4/lib/libmyodbc5.so' : file not found

            [ISQL]ERROR: Could not SQLConnect

             

            i got error shown above.

                       can anybody help ,where am i doing mistake? your help appreciated.

             

            thanks & regards

            • 3. Re: oracle to mysql
              Mkirtley-Oracle

              Hi,

                You said -

               

              i downloaded mysql connector odbc (i did not install it because already there in my machine


              So, do you actually have the driver in the location indicated -

               

              /opt/oradb/patches/mysql connector/lib/libmyodbc5.so

               

              Regards,

              Mike

              • 4. Re: oracle to mysql
                ora_learner36

                hello,

                      I dont have driver "libmyodbc5.so" in the indicated location i.e "/opt/oradb/patches/mysql connector/lib". i just downloaded mysql connector odbc 5.3.4 and unzip  it ,that's it .How can i install this driver, do i need to run "mysql installer" located in "/opt/oradb/patches/mysql connector/bin"?  can you help please,because first time i m doing this so i dont know ?

                 

                thanks & regards.

                • 5. Re: oracle to mysql
                  Mkirtley-Oracle

                  Hi,

                    It depends which download you used and what you did with it.
                  Did you start here -

                   

                  MySQL :: Download Connector/ODBC

                   

                  and then have a look at the install information linked from there -

                   

                  MySQL :: MySQL Connector/ODBC Developer Guide :: 4 Connector/ODBC Installation

                   

                  ad for Linux -

                   

                  MySQL :: MySQL Connector/ODBC Developer Guide :: 4.2 Installing Connector/ODBC on Unix-like Systems

                   

                  Regards,

                  Mike

                  • 6. Re: oracle to mysql
                    ora_learner36

                    thanks for replying,i already saw those docs. but there is not mentioned how to run the utility "myodbc-installer".if you know please let me know.

                     

                    thanks & regards.

                    • 7. Re: oracle to mysql
                      Mkirtley-Oracle

                      Hi,

                        Which download are you using - RPM package or compressed TAR archive ?  What is the full name and version of the OS on which you are installing ?

                      The links have the steps on what to do for each download.

                      If you are not sure what to do then please detail all the steps you have followed so we know at what stage you are having problems.

                       

                      Regards,

                      Mike

                      • 8. Re: oracle to mysql
                        ora_learner36

                        Hello,

                                thanks once again for replying me,i am using "compressed TAR archive" .

                        OS is RHEL 6.7 64 bit ,all the steps which i am following are as shown below.

                         

                        1. i checked for avaible unixodbc manager and mysql connector odbc

                        ]$ rpm -qa unix*

                        unixODBC-devel-2.2.14-11.el6.x86_64

                        unixODBC-2.2.14-11.el6.x86_64

                         

                        ]$ rpm -qa mysql*

                        mysql-5.1.52-1.el6_0.1.x86_64

                        mysql-devel-5.1.52-1.el6_0.1.x86_64

                        mysql-server-5.1.52-1.el6_0.1.x86_64

                        mysql-connector-odbc-5.1.5r1144-7.el6.x86_64

                        mysql-libs-5.1.52-1.el6_0.1.x86_64

                         

                        2) i downloaded unixODBC driver manager

                         

                        1. copy the unixODBC-2.3.2.tar.gz file somewhere you can create files and directories

                        2. gunzip unixODBC*.tar.gz

                        3. tar xvf unixODBC*.tar

                        Make the Libraries and Programs

                        The install uses the standard GNU autoconf process. So its simply a matter of running

                        ./configure  --prefix=/opt/oradb/patches/unixODBC

                        make

                        make install

                         

                        3) i downloaded mysql connector odbc(i did not install it because already there in my machine)

                        1.download mysql-connector-odbc-5.3.4-linux-el6-x86-64bit.tar.gz

                        2.gunzip -c mysql-connector-odbc-5.3.4-linux-el6-x86-64bit.tar.gz | tar xvf -

                        ]$ls /opt/oradb/patches/mysql connector/lib     (no file libmyodbc5.so)

                        libmyodbc5a.so

                        libmyodbc5s.so

                        libmyodbc5w.so

                         

                        4)

                        etc]$ cat odbc.ini

                        [myodbc5]

                        Description = ortomysql

                        Driver      = /opt/oradb/patches/mysql connector/lib/libmyodbc5.so

                        Server      = 192.168.0.21

                        Database    =<dbname>

                        LogonID     =root

                        Password    =<pwd>

                        Port        =3306

                        Socket      =

                        Option      =

                        Stmt        =

                         

                        [ODBC Data Sources]

                         

                        5)

                        ]$ cd /opt/oradb/patches/unixODBC/bin------------(unixODBC driver manager directory)

                        ]$./isql myodbc5 -v


                        [01000][unixODBC][Driver Manager]Can't open lib '/opt/oradb/patches/myodbc-5.3.4/lib/libmyodbc5.so' : file not found

                        [ISQL]ERROR: Could not SQLConnect

                         

                        i got error shown above.

                        • 9. Re: oracle to mysql
                          mxallen-Oracle

                          Is there a libmyodbc5.so file in '/opt/oradb/patches/myodbc-5.3.4/lib'?

                           

                          You mention there is NOT one in /opt/oradb/patches/mysql connector/lib, but never mention

                          checking the directory referenced in the error.

                           

                          I ask because I was looking around and found this link that looks very similar to your problem:

                          https://bbs.archlinux.org/viewtopic.php?id=118521

                           

                          You can take a look at it and see if it is relevant.

                          As Mike suggested previously, you might have more success with this in a MySQL Forum.

                           

                          Regards,

                          Matt