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. [SOLVED] - MYSQL driver Found but not Loaded in Windows XP / 2003
QtWS25 Last Chance

[SOLVED] - MYSQL driver Found but not Loaded in Windows XP / 2003

Scheduled Pinned Locked Moved General and Desktop
12 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.
  • Y Offline
    Y Offline
    ypspef
    wrote on last edited by
    #1

    I'm having problems when I want to open an MYSQL database.
    Here's my setup :

    • environment variable QT_DEBUG_PLUGINS set to 1
    • O.S. Windows XP / Windows 2003
    • Qt version 5.3
    • Mysql C connector version 6.1.5

    Source code executed to open DB :

    @
    db.setHostName( hostName );
    db.setDatabaseName( databaseName );
    db.setUserName( databaseUser );
    db.setPassword( databasePassword );

    res = db.open();
    

    @

    and I got this output :
    @
    QFactoryLoader::QFactoryLoader() looking at "C:/Program Files/MySQL/MySQL Connector.C 6.1/lib/sqldrivers/qsqlmysqld.dll"
    Found metadata in lib C:/Program Files/MySQL/MySQL Connector.C 6.1/lib/sqldrivers/qsqlmysqld.dll, metadata=
    {
    "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
    "MetaData": {
    "Keys": [
    "QMYSQL3",
    "QMYSQL"
    ]
    },
    "className": "QMYSQLDriverPlugin",
    "debug": true,
    "version": 328450
    }

    Got keys from plugin meta data ("QMYSQL3", "QMYSQL")
    loaded library "C:/Qt/Qt5.3.2/5.3/mingw482_32/plugins/sqldrivers/qsqlmysqld.dll"
    QLibraryPrivate::loadPlugin failed on "C:/Qt/Qt5.3.2/5.3/mingw482_32/plugins/sqldrivers/qsqlmysqld.dll" : "Cannot load library C:/Qt/Qt5.3.2/5.3/mingw482_32/plugins/sqldrivers/qsqlmysqld.dll: The specified procedure could not be found."
    QSqlDatabase: QMYSQL driver not loaded
    QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7
    @

    I've copied the file libmysql.dll to QtXXX/bin/ ... and all other paths indicated by qApp->librartPaths.

    But still the same error.

    Strange thing is that this same setup works fine on Windows 7.

    Ideas ? Suggestions ?

    Thanks.

    Regards.

    Facundo.

    [Edited: Added Code tags "@@" - p3c0]

    1 Reply Last reply
    0
    • Y Offline
      Y Offline
      ypspef
      wrote on last edited by
      #2

      BTW : dependencywalker shows no error.

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        Are you sure that the MySQL dll's can be found by the application e.g. is the folder containing them in the PATH environment variable ?

        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
        0
        • Y Offline
          Y Offline
          ypspef
          wrote on last edited by
          #4

          Yes. In my case the libmysql.dll is located at C:\Program Files\MySQL\MySQL Connector.C 6.1\lib\ that it is already in the path.

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Then, did you check the PATH environment variable in Qt Creator in the Run panel ?

            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
            0
            • Y Offline
              Y Offline
              ypspef
              wrote on last edited by
              #6

              Yes. Also there. Actually it is defined at operating system level.

              1 Reply Last reply
              0
              • hskoglundH Offline
                hskoglundH Offline
                hskoglund
                wrote on last edited by
                #7

                Hi, do you get the same error in Release build (instead of Debug)?

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  sonyericsson0819
                  wrote on last edited by
                  #8

                  I have the same problem on Qt 5.4,I use Qt in Windows 7 and Mint17.I have tried " Release build",but error still exist.

                  And when I get the debug infomation,I find that it says:

                  libqsqlmysql.so: (/usr/lib/x86_64-linux-gnu/libmysqlclient_r.so.16: version `libmysqlclient_16' not found (required by /opt/Qt5.4.0/5.4/gcc_64/plugins/sqldrivers/libqsqlmysql.so))"

                  but I just have libmysqlclient_r.so.18... ...
                  though I make symbolic links,It still doesn't work

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    You need to either install the .16 version or rebuild the plugin against your .18 version

                    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
                    0
                    • Y Offline
                      Y Offline
                      ypspef
                      wrote on last edited by
                      #10

                      ... same error on release version ...also now using Qt 5.4 ...

                      1 Reply Last reply
                      0
                      • hskoglundH Offline
                        hskoglundH Offline
                        hskoglund
                        wrote on last edited by
                        #11

                        Hi, googled a bit on why your MySQL Connector/C version 6.1.5 does not load and found some bad news: it seems starting with MySQL version 5.6 using it on Win XP or Win2K3 "is no longer supported":http://dev.mysql.com/doc/relnotes/connector-c/en/news-6-1-2.html (not a happy new year :-(

                        1 Reply Last reply
                        0
                        • Y Offline
                          Y Offline
                          ypspef
                          wrote on last edited by
                          #12

                          Thanks for your answer !!! ...
                          So I think that in machines with XP or 2003 I'll use another DB.

                          Regards.
                          Facundo.

                          1 Reply Last reply
                          0

                          • Login

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