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. MySQL plugin, mingw64 and Windows 8.1 - QMYSQL driver not loaded
Forum Updated to NodeBB v4.3 + New Features

MySQL plugin, mingw64 and Windows 8.1 - QMYSQL driver not loaded

Scheduled Pinned Locked Moved Solved General and Desktop
17 Posts 4 Posters 5.5k Views 2 Watching
  • 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.
  • SGaistS SGaist

    Which version did you install exactly ?

    AggsA Offline
    AggsA Offline
    Aggs
    wrote on last edited by
    #8

    @SGaist The details from Qt Creator's option menu:

    
    Name: Qt 5.6.0 (mingw64)
    ABI: x86-windows-msys-pe-64bit
    Source: C:\msys64\mingw64
    mkspec: win32-g++
    qmake: C:\msys64\mingw64\bin\qmake.exe
    Default: debug
    Version: 5.6.0
    QMAKE_SPEC win32-g++
    QMAKE_VERSION 3.0
    QMAKE_XSPEC win32-g++
    QT_HOST_BINS C:\msys64\mingw64\bin
    QT_HOST_DATA C:\msys64\mingw64\share\qt5
    QT_HOST_LIBS C:\msys64\mingw64\lib
    QT_HOST_PREFIX C:\msys64\mingw64
    QT_INSTALL_ARCHDATA C:\msys64\mingw64\share\qt5
    QT_INSTALL_BINS C:\msys64\mingw64\bin
    QT_INSTALL_CONFIGURATION 
    QT_INSTALL_DATA C:\msys64\mingw64\share\qt5
    QT_INSTALL_DEMOS C:\msys64\mingw64\share\qt5\examples
    QT_INSTALL_DOCS C:\msys64\mingw64\share\qt5\doc
    QT_INSTALL_EXAMPLES C:\msys64\mingw64\share\qt5\examples
    QT_INSTALL_HEADERS C:\msys64\mingw64\include
    QT_INSTALL_IMPORTS C:\msys64\mingw64\share\qt5\imports
    QT_INSTALL_LIBEXECS C:\msys64\mingw64\share\qt5\bin
    QT_INSTALL_LIBS C:\msys64\mingw64\lib
    QT_INSTALL_PLUGINS C:\msys64\mingw64\share\qt5\plugins
    QT_INSTALL_PREFIX C:\msys64\mingw64
    QT_INSTALL_QML C:\msys64\mingw64\share\qt5\qml
    QT_INSTALL_TESTS C:\msys64\mingw64\share\qt5\tests
    QT_INSTALL_TRANSLATIONS C:\msys64\mingw64\share\qt5\translations
    QT_SYSROOT 
    QT_VERSION 5.6.0
    
    
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #9

      I meant where did you get that package ?

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

      AggsA 1 Reply Last reply
      0
      • SGaistS SGaist

        I meant where did you get that package ?

        AggsA Offline
        AggsA Offline
        Aggs
        wrote on last edited by
        #10

        @SGaist Oh, I used MSYS2 to install it with the command: pacman -Sy mingw-w64-{i686,x86_64}-qt5

        Qt Creator is the GPL Windows version from the main site. (this is 32bit which I thought might cause problems but everything else seems to work - I can compile and run 64bit applications that don't use MySQL)

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

          For Qt Creator, no there's no influence. It only uses Qt, the architecture of it is of no importance for the functionality (unless of course you are building a plugin for it)

          Silly question but: do you have a MinGW64 build of MySQL available on your machine ?

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

          AggsA 1 Reply Last reply
          0
          • SGaistS SGaist

            For Qt Creator, no there's no influence. It only uses Qt, the architecture of it is of no importance for the functionality (unless of course you are building a plugin for it)

            Silly question but: do you have a MinGW64 build of MySQL available on your machine ?

            AggsA Offline
            AggsA Offline
            Aggs
            wrote on last edited by
            #12

            @SGaist I don't have MySQL database installed on this machine (as I have another machine setup as a server with it)

            I have a 64bit version of MySQL Workbench which was installed from the pre-compiled binaries. This contains the 64bit libmysql.dll which I am using.

            Somehow I also have a 32bit version of libmysql.dll although I'm not quite sure where this came from. I've been using it for some time as it works when I compile a 32bit version of my application.

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

              Then I wonder if the 32bit version of libmysql is found before the 64bit version.

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

              AggsA 1 Reply Last reply
              0
              • SGaistS SGaist

                Then I wonder if the 32bit version of libmysql is found before the 64bit version.

                AggsA Offline
                AggsA Offline
                Aggs
                wrote on last edited by
                #14

                @SGaist I don't think so. When I remove the 32bit libmysql.dll file the 32bit version of my app stops working but the 64bit version still doesn't work.

                And when:
                LoadLibraryExA("libmysql.dll", NULL, NULL);
                is called, it successfully loads the library on both the 32bit and 64bit versions of my app.

                AggsA 1 Reply Last reply
                0
                • AggsA Aggs

                  @SGaist I don't think so. When I remove the 32bit libmysql.dll file the 32bit version of my app stops working but the 64bit version still doesn't work.

                  And when:
                  LoadLibraryExA("libmysql.dll", NULL, NULL);
                  is called, it successfully loads the library on both the 32bit and 64bit versions of my app.

                  AggsA Offline
                  AggsA Offline
                  Aggs
                  wrote on last edited by
                  #15

                  This is the dependences from qsqlmysql.dll (http://imgur.com/MUMHGfN)

                  Just noticed that it seems a bit odd that libmariadb.dll is needed but libmysql.dll isn't?

                  1 Reply Last reply
                  0
                  • AggsA Offline
                    AggsA Offline
                    Aggs
                    wrote on last edited by
                    #16

                    And that was the problem. I added libmariadb.dll to the same folder as the executable (same place as libmysql.dll) and now it all works!

                    Why I need a MariaDB library to connect to a MySQL database is still a mystery to me though... In fact libmysql.dll isn't even used - I just removed it and it still works.

                    Thanks for the help anyway! (if I can work out how, I'll mark this thread as solved)

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

                      MariaDB is a drop-in replacement for MySQL and AFAIK, you should be able to connect to MySQL servers through the MariaDB client libraries.

                      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

                      • Login

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