Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QMYSQL : Driver not loaded
Forum Update on Monday, May 27th 2025

QMYSQL : Driver not loaded

Scheduled Pinned Locked Moved Unsolved General and Desktop
15 Posts 4 Posters 3.7k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Trav
    wrote on 26 Jan 2017, 07:35 last edited by
    #3

    Followed that link all the way through and unfortunately I'm still getting the same error as above ^

    1 Reply Last reply
    0
    • T Offline
      T Offline
      Trav
      wrote on 26 Jan 2017, 08:23 last edited by Trav
      #4

      last command I put in was ''''' install_name_tool -change /usr/local/lib/libmysqlclient.18.dylib /usr/local/Cellar/mysql/5.7.17/lib/libmysqlclient.dylib libqsqlmysql.dylib '''' I did some research and this seems to be the correct way to be doing it in context of placing the driver i'm not sure whats going on now though from that command it should be working looking in /usr/local/Cellar/mysql/5.7.17 and running ls i have these files present

      cd lib
      192:lib trav$ ls
      libmysqlclient.20.dylib libmysqld.a plugin
      libmysqlclient.a libmysqlservices.a
      libmysqlclient.dylib pkgconfig

      as well as running cd /usr/local/lib then ls I can see that ( see down) are present along with other ones i only included first 5 just for example

      libexiv2.14.0.0.dylib
      libexiv2.14.dylib
      libexiv2.dylib
      libmysqlclient.18.dylib
      libmysqlclient.20.dylib

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 26 Jan 2017, 21:03 last edited by
        #5

        Hi,

        What does otool -L libqsqlmysql.dylib return ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        T 1 Reply Last reply 27 Jan 2017, 01:32
        0
        • S SGaist
          26 Jan 2017, 21:03

          Hi,

          What does otool -L libqsqlmysql.dylib return ?

          T Offline
          T Offline
          Trav
          wrote on 27 Jan 2017, 01:32 last edited by
          #6

          @SGaist said in QMYSQL : Driver not loaded:

          otool -L libqsqlmysql.dylib

          Thank you for the reply!
          trav$ otool -L libqsqlmysql.dylib
          /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/objdump: 'libqsqlmysql.dylib': No such file or directory.
          fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/otool: internal objdump command failed

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 27 Jan 2017, 08:32 last edited by
            #7

            otool -L /path/to/location/of/libqsqlmysql.dylib

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            T 1 Reply Last reply 27 Jan 2017, 09:11
            0
            • T Offline
              T Offline
              Trav
              wrote on 27 Jan 2017, 09:03 last edited by
              #8
              This post is deleted!
              1 Reply Last reply
              0
              • S SGaist
                27 Jan 2017, 08:32

                otool -L /path/to/location/of/libqsqlmysql.dylib

                T Offline
                T Offline
                Trav
                wrote on 27 Jan 2017, 09:11 last edited by
                #9

                @SGaist

                trav$ otool -L /usr/local/Cellar/mysql/5.7.17/lib/libmysqlclient.dylib

                /usr/local/Cellar/mysql/5.7.17/lib/libmysqlclient.dylib:
                /usr/local/opt/mysql/lib/libmysqlclient.20.dylib (compatibility version 20.0.0, current version 20.0.0)
                /usr/local/opt/openssl/lib/libssl.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
                /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
                /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 307.4.0)
                /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.0.0)

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 27 Jan 2017, 09:59 last edited by
                  #10

                  I'm asking you to run otool on the Qt MySQL plugin. The path I've used in the command samples are meant to be replaced by the actual path to where the plugin is located. I don't know where it is on your system, so don't just copy paste the command, update it as well.

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  T 1 Reply Last reply 27 Jan 2017, 18:05
                  0
                  • S SGaist
                    27 Jan 2017, 09:59

                    I'm asking you to run otool on the Qt MySQL plugin. The path I've used in the command samples are meant to be replaced by the actual path to where the plugin is located. I don't know where it is on your system, so don't just copy paste the command, update it as well.

                    T Offline
                    T Offline
                    Trav
                    wrote on 27 Jan 2017, 18:05 last edited by Trav
                    #11

                    @SGaist Sorry was 3 am. Deleted that comment as soon as I knew what I did I updated it immediately though with the correct path ^

                    trav$ otool -L /usr/local/Cellar/mysql/5.7.17/lib/libmysqlclient.dylib

                    /usr/local/Cellar/mysql/5.7.17/lib/libmysqlclient.dylib:
                    /usr/local/opt/mysql/lib/libmysqlclient.20.dylib (compatibility version 20.0.0, current version 20.0.0)
                    /usr/local/opt/openssl/lib/libssl.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
                    /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
                    /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 307.4.0)
                    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.0.0)

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on 27 Jan 2017, 20:46 last edited by
                      #12

                      Not the MySQL client library, the Qt MySQL plugiin libqsqlmysql.dylib that can be found in the plugins/sqldrivers folder in your Qt installation.

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      T 1 Reply Last reply 28 Jan 2017, 00:46
                      1
                      • S SGaist
                        27 Jan 2017, 20:46

                        Not the MySQL client library, the Qt MySQL plugiin libqsqlmysql.dylib that can be found in the plugins/sqldrivers folder in your Qt installation.

                        T Offline
                        T Offline
                        Trav
                        wrote on 28 Jan 2017, 00:46 last edited by
                        #13

                        @SGaist
                        pwd
                        /Users/trav/Qt/5.6/clang_64/plugins/sqldrivers

                        trav$ otool -L libqsqlmysql.dylib
                        libqsqlmysql.dylib:
                        libqsqlmysql.dylib (compatibility version 0.0.0, current version 0.0.0)
                        /opt/local/lib/mysql55/mysql/libmysqlclient.18.dylib (compatibility version 18.0.0, current version 18.0.0)
                        /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
                        @rpath/QtSql.framework/Versions/5/QtSql (compatibility version 5.6.0, current version 5.6.0)
                        @rpath/QtCore.framework/Versions/5/QtCore (compatibility version 5.6.0, current version 5.6.0)
                        /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)
                        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1225.1.1)
                        Traviss-Air:sqldrivers trav$

                        A 1 Reply Last reply 28 Jan 2017, 05:17
                        0
                        • T Trav
                          28 Jan 2017, 00:46

                          @SGaist
                          pwd
                          /Users/trav/Qt/5.6/clang_64/plugins/sqldrivers

                          trav$ otool -L libqsqlmysql.dylib
                          libqsqlmysql.dylib:
                          libqsqlmysql.dylib (compatibility version 0.0.0, current version 0.0.0)
                          /opt/local/lib/mysql55/mysql/libmysqlclient.18.dylib (compatibility version 18.0.0, current version 18.0.0)
                          /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
                          @rpath/QtSql.framework/Versions/5/QtSql (compatibility version 5.6.0, current version 5.6.0)
                          @rpath/QtCore.framework/Versions/5/QtCore (compatibility version 5.6.0, current version 5.6.0)
                          /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)
                          /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1225.1.1)
                          Traviss-Air:sqldrivers trav$

                          A Offline
                          A Offline
                          ambershark
                          wrote on 28 Jan 2017, 05:17 last edited by
                          #14

                          @Trav said in QMYSQL : Driver not loaded:

                          @SGaist
                          pwd
                          /Users/trav/Qt/5.6/clang_64/plugins/sqldrivers

                          trav$ otool -L libqsqlmysql.dylib
                          libqsqlmysql.dylib:
                          libqsqlmysql.dylib (compatibility version 0.0.0, current version 0.0.0)
                          /opt/local/lib/mysql55/mysql/libmysqlclient.18.dylib (compatibility version 18.0.0, current version 18.0.0)

                          Here's your problem... It is looking for mysql in the /opt/local/lib directory (which is a weird directory), when according to your post above it is in /usr/local/opt/mysql.

                          Usually people use /usr/local or /opt. I've never seen /opt/local. But it's not like there's set rules for directories or anything, so to each their own.

                          Anyway use otool to fix those paths and it should work.

                          My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

                          1 Reply Last reply
                          1
                          • S Offline
                            S Offline
                            SGaist
                            Lifetime Qt Champion
                            wrote on 28 Jan 2017, 19:22 last edited by
                            #15

                            It's not weird for tools that are external to the distribution if we talk Linux style.

                            In this case, it's macports that is using it like that.

                            In any cas, the parameters passed to install_name_tool must be correct there's no error message telling you that the paths are invalid.

                            Interested in AI ? www.idiap.ch
                            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                            1 Reply Last reply
                            1

                            12/15

                            27 Jan 2017, 20:46

                            • Login

                            • Login or register to search.
                            12 out of 15
                            • First post
                              12/15
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • Users
                            • Groups
                            • Search
                            • Get Qt Extensions
                            • Unsolved