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 Updated to NodeBB v4.3 + New Features

QMYSQL DRIVER NOT LOADED

Scheduled Pinned Locked Moved Solved General and Desktop
13 Posts 4 Posters 1.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

    Hi and welcome to devnet,

    You are missing a double quote in the LIBS part of your qmake call.

    N Offline
    N Offline
    nguyendinh
    wrote on last edited by
    #3

    @SGaist said in QMYSQL DRIVER NOT LOADED:

    Hi and welcome to devnet,
    You are missing a double quote in the LIBS part of your qmake call.

    Thanks for reply I see you solved this problem in other topic but What i was wrong :((
    qt5.PNG

    jsulmJ 1 Reply Last reply
    0
    • N nguyendinh

      @SGaist said in QMYSQL DRIVER NOT LOADED:

      Hi and welcome to devnet,
      You are missing a double quote in the LIBS part of your qmake call.

      Thanks for reply I see you solved this problem in other topic but What i was wrong :((
      qt5.PNG

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #4

      @nguyendinh said in QMYSQL DRIVER NOT LOADED:

      What i was wrong

      It would be nice if you would put text instead of screen-shots!
      What you are doing wrong: you need to put paths containing spaces into "". If you take time to take a closer look at your screen- shot you will see what is wrong: the path to include directory contains spaces, but you did not put it into "", so you have stuff like:

      -IC:\Program -IFiles
      

      which is of course wrong.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • N Offline
        N Offline
        nguyendinh
        wrote on last edited by nguyendinh
        #5

        @jsulm
        Thanks for your support
        This my command in QT 5.14.1 mingW 7.3.0 32bit
        (I use MYSQL 8.0 64 bit)

        This my command:
        1.cd C:\Qt\Qt5.14.1\5.14.1\Src\qtbase\src\plugins\sqldrivers\mysql
        2.qmake "INCLUDEPATH+=C:\Program Files\MySQL\MySQL Server 8.0\include" "LIBS+=C:\Program Files\MySQL\MySQL Server 8.0\lib\libmysql.lib" mysql.pro

        And then this equal:
        q1.PNG

        jsulmJ 1 Reply Last reply
        0
        • N nguyendinh

          @jsulm
          Thanks for your support
          This my command in QT 5.14.1 mingW 7.3.0 32bit
          (I use MYSQL 8.0 64 bit)

          This my command:
          1.cd C:\Qt\Qt5.14.1\5.14.1\Src\qtbase\src\plugins\sqldrivers\mysql
          2.qmake "INCLUDEPATH+=C:\Program Files\MySQL\MySQL Server 8.0\include" "LIBS+=C:\Program Files\MySQL\MySQL Server 8.0\lib\libmysql.lib" mysql.pro

          And then this equal:
          q1.PNG

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #6

          @nguyendinh said in QMYSQL DRIVER NOT LOADED:

          qmake "INCLUDEPATH+=C:\Program Files\MySQL\MySQL Server 8.0\include" "LIBS+=C:\Program Files\MySQL\MySQL Server 8.0\lib\libmysql.lib" mysql.pro

          qmake INCLUDEPATH+="C:\Program Files\MySQL\MySQL Server 8.0\include" LIBS+="C:\Program Files\MySQL\MySQL Server 8.0\lib\libmysql.lib" mysql.pro
          

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          N 2 Replies Last reply
          0
          • jsulmJ jsulm

            @nguyendinh said in QMYSQL DRIVER NOT LOADED:

            qmake "INCLUDEPATH+=C:\Program Files\MySQL\MySQL Server 8.0\include" "LIBS+=C:\Program Files\MySQL\MySQL Server 8.0\lib\libmysql.lib" mysql.pro

            qmake INCLUDEPATH+="C:\Program Files\MySQL\MySQL Server 8.0\include" LIBS+="C:\Program Files\MySQL\MySQL Server 8.0\lib\libmysql.lib" mysql.pro
            
            N Offline
            N Offline
            nguyendinh
            wrote on last edited by nguyendinh
            #7

            @jsulm Thanks you but the same as
            1.cd C:\Qt\Qt5.14.1\5.14.1\Src\qtbase\src\plugins\sqldrivers\mysql
            2.qmake INCLUDEPATH+="C:\Program Files\MySQL\MySQL Server 8.0\include" LIBS+="C:\Program Files\MySQL\MySQL Server 8.0\lib\libmysql.lib" mysql.pro
            3.mingw32-make

            q2.PNG

            jsulmJ 1 Reply Last reply
            0
            • N nguyendinh

              @jsulm Thanks you but the same as
              1.cd C:\Qt\Qt5.14.1\5.14.1\Src\qtbase\src\plugins\sqldrivers\mysql
              2.qmake INCLUDEPATH+="C:\Program Files\MySQL\MySQL Server 8.0\include" LIBS+="C:\Program Files\MySQL\MySQL Server 8.0\lib\libmysql.lib" mysql.pro
              3.mingw32-make

              q2.PNG

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #8

              @nguyendinh Your screen-shot still shows your wrong qmake call...
              Please do it like I suggested.

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              N 1 Reply Last reply
              1
              • jsulmJ jsulm

                @nguyendinh Your screen-shot still shows your wrong qmake call...
                Please do it like I suggested.

                N Offline
                N Offline
                nguyendinh
                wrote on last edited by
                #9

                @jsulm sorry I upload wrong images
                i copied your command but the equal same as:
                1.cd C:\Qt\Qt5.14.1\5.14.1\Src\qtbase\src\plugins\sqldrivers\mysql
                2.qmake INCLUDEPATH+="C:\Program Files\MySQL\MySQL Server 8.0\include" LIBS+="C:\Program Files\MySQL\MySQL Server 8.0\lib\libmysql.lib"mysql.pro
                3.mingw32-make

                Thanks best for your time!!!
                q4.PNG

                jsulmJ 1 Reply Last reply
                0
                • N nguyendinh

                  @jsulm sorry I upload wrong images
                  i copied your command but the equal same as:
                  1.cd C:\Qt\Qt5.14.1\5.14.1\Src\qtbase\src\plugins\sqldrivers\mysql
                  2.qmake INCLUDEPATH+="C:\Program Files\MySQL\MySQL Server 8.0\include" LIBS+="C:\Program Files\MySQL\MySQL Server 8.0\lib\libmysql.lib"mysql.pro
                  3.mingw32-make

                  Thanks best for your time!!!
                  q4.PNG

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #10

                  @nguyendinh Please make sure you call qmake/make from a clean state. Means: remove all build artefacts first. Better do out of source build (not from source code directory).

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  1
                  • jsulmJ jsulm

                    @nguyendinh said in QMYSQL DRIVER NOT LOADED:

                    qmake "INCLUDEPATH+=C:\Program Files\MySQL\MySQL Server 8.0\include" "LIBS+=C:\Program Files\MySQL\MySQL Server 8.0\lib\libmysql.lib" mysql.pro

                    qmake INCLUDEPATH+="C:\Program Files\MySQL\MySQL Server 8.0\include" LIBS+="C:\Program Files\MySQL\MySQL Server 8.0\lib\libmysql.lib" mysql.pro
                    
                    N Offline
                    N Offline
                    nguyendinh
                    wrote on last edited by
                    #11

                    @jsulm Thanks every body In this day , I solved the problem. All problem in Makefile
                    Makefile buid qsqlmysql.dll driver but the linked LIBS or INCLUDEPATH wrong because you using more than 1 qmake command . And this solved you put the true link in Makefile
                    (Makefile in C:\Qt\Qt5.14.1\5.14.1\Src\qtbase\src\plugins\sqldrivers)
                    q1.PNG

                    You can fix Makefile in with notepad or etc and then save file
                    then again in QT command run: mingw32-make

                    and then qsqlmysql build in C:\Qt\Qt5.14.1\5.14.1\Src\qtbase\src\plugins\sqldrivers\plugins\sqldrivers
                    then you have to coppy this file for C:\Qt\Qt5.14.1\5.14.1\mingw73_32\plugins\sqldrivers

                    Now we can connect to mysql workbench Thanks for all.

                    lincolnL 1 Reply Last reply
                    0
                    • N nguyendinh

                      @jsulm Thanks every body In this day , I solved the problem. All problem in Makefile
                      Makefile buid qsqlmysql.dll driver but the linked LIBS or INCLUDEPATH wrong because you using more than 1 qmake command . And this solved you put the true link in Makefile
                      (Makefile in C:\Qt\Qt5.14.1\5.14.1\Src\qtbase\src\plugins\sqldrivers)
                      q1.PNG

                      You can fix Makefile in with notepad or etc and then save file
                      then again in QT command run: mingw32-make

                      and then qsqlmysql build in C:\Qt\Qt5.14.1\5.14.1\Src\qtbase\src\plugins\sqldrivers\plugins\sqldrivers
                      then you have to coppy this file for C:\Qt\Qt5.14.1\5.14.1\mingw73_32\plugins\sqldrivers

                      Now we can connect to mysql workbench Thanks for all.

                      lincolnL Offline
                      lincolnL Offline
                      lincoln
                      wrote on last edited by
                      #12

                      @nguyendinh link text

                      Solitary wolf

                      N 1 Reply Last reply
                      0
                      • lincolnL lincoln

                        @nguyendinh link text

                        N Offline
                        N Offline
                        nguyendinh
                        wrote on last edited by
                        #13

                        @lincoln Capture.PNG

                        Open Makefile with notepad or IDE C++ , config and then save file.

                        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