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. Error QMYSQL Plugin on Windows
Forum Updated to NodeBB v4.3 + New Features

Error QMYSQL Plugin on Windows

Scheduled Pinned Locked Moved Unsolved General and Desktop
59 Posts 8 Posters 17.6k Views 1 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 Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #4

    Did you even look at the content of the folder you went into ? Noticed that there are no .pro file in there ?

    You are in a Qt installation. As already suggested many times: you have to download the Qt sources.

    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
    2
    • S Offline
      S Offline
      Stelian
      wrote on last edited by
      #5

      I did not know I had to download Qt sources.
      Give me a link for the Qt sources, I found something on the internet, but I trust you a lot.
      Thank you for your answer and for your help.
      I really need Qt.

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

        Well, it's explained in the numerous threads already opened on this very forum.

        No need for a link, you can get the sources directly using the Maintenance Tool available 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

        1 Reply Last reply
        2
        • S Offline
          S Offline
          Stelian
          wrote on last edited by
          #7

          Maintenance Tool does not work, I get the next message: at least one valid and enabled repository required for this action to succeed
          In the Maintenance Tool, start by selecting "Update components". Then click on the Settings button.
          Then a Settings window will open and in there, then click the Repositories tab, click on User defined repositories, click on the Add button and type http://download.qt-project.org/online/qtsdkrepository/windows_x86/desktop/tools_maintenance.
          I tried many website but still I get the same message.

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

            So you used the offline installer ?

            Anyway, there's not that many website: http://download.qt.io/official_releases/qt/ the single folder under the version folders contain the sources. Since you're on Windows get the .zip file.

            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
            3
            • S Offline
              S Offline
              Stelian
              wrote on last edited by Stelian
              #9
              This post is deleted!
              1 Reply Last reply
              1
              • S Offline
                S Offline
                Stelian
                wrote on last edited by
                #10

                I downloaded qt-everywhere-src-5.12.1 and from what I got from https://www.seppemagiels.com/blog/create-mysql-driver-qt5-windows#mysql_path_note, I renamed the folder to Sources instead of the long qt-everywhere-src-5.12.1.
                I also placed it in the Qt folder was installed in. (C:\Qt\ Qt5.12.1)
                Open cmd.exe, and enter the following commands:
                c:\Qt\Qt5.12.1\5.12.1\mingw73_64\plugins\sqldrivers>C:/Qt/Qt5.12.1/5.12.1/mingw73_64/bin/qmake -- MYSQL_INCDIR=C:/MySQL/include "MYSQL_LIBDIR=C:/Program Files/MYSQL/MySQL Server 8.0/lib/libmysql.lib" mysql.pro
                and again ... I'm disappointed

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

                  That line doesn't make sense, why are you trying to execute qmake inside the sqldrivers folder from your already installed Qt ? And why are you passing once the path without space for the includes and then the one with spaces for the 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
                  • S Offline
                    S Offline
                    Stelian
                    wrote on last edited by Stelian
                    #12

                    What is the right line ?
                    I have read the post from https://forum.qt.io/topic/92626/cant-connect-to-mysql-database-qmysql-driver-not-loaded/15 line by line but it doesn't fit.
                    Please, light me!

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      Stelian
                      wrote on last edited by Stelian
                      #13

                      I will start again.
                      On website https://doc.qt.io/qt-5/sql-driver.html#how-to-build-the-qmysql-plugin-on-windows
                      first line is: cd %QTDIR%\qtbase\src\plugins\sqldrivers wich for me is:
                      c:\Qt\Qt5.12.1\5.12.1\mingw73_64\plugins\sqldrivers>

                      Now I'll go back to website
                      second line:
                      qmake -- MYSQL_INCDIR=C:\MySQL\include "MYSQL_LIBDIR=C:\MYSQL\MySQL Server <version>\lib\opt"

                      MYSQL_INCDIR is include folder from MySql folder
                      MYSQL_LIBDIR is lib folder from MySql folder

                      For me the second line it should be something like this

                      c:\Qt\Qt5.12.1\5.12.1\mingw73_64\plugins\sqldrivers>qmake -- MYSQL_INCDIR=C:\Program Files\MySQL\MySQL Server 8.0\include "MYSQL_LIBDIR=C:\Program Files\MySQL\MySQL Server 8.0\include"
                      When I run this line I get an error: 'qmake' is not recognized as an internal or external command,
                      operable program or batch file.

                      Also I don't find the opt folder

                      jsulmJ 1 Reply Last reply
                      0
                      • S Stelian

                        I will start again.
                        On website https://doc.qt.io/qt-5/sql-driver.html#how-to-build-the-qmysql-plugin-on-windows
                        first line is: cd %QTDIR%\qtbase\src\plugins\sqldrivers wich for me is:
                        c:\Qt\Qt5.12.1\5.12.1\mingw73_64\plugins\sqldrivers>

                        Now I'll go back to website
                        second line:
                        qmake -- MYSQL_INCDIR=C:\MySQL\include "MYSQL_LIBDIR=C:\MYSQL\MySQL Server <version>\lib\opt"

                        MYSQL_INCDIR is include folder from MySql folder
                        MYSQL_LIBDIR is lib folder from MySql folder

                        For me the second line it should be something like this

                        c:\Qt\Qt5.12.1\5.12.1\mingw73_64\plugins\sqldrivers>qmake -- MYSQL_INCDIR=C:\Program Files\MySQL\MySQL Server 8.0\include "MYSQL_LIBDIR=C:\Program Files\MySQL\MySQL Server 8.0\include"
                        When I run this line I get an error: 'qmake' is not recognized as an internal or external command,
                        operable program or batch file.

                        Also I don't find the opt folder

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

                        @Stelian You need to call qmake from the source code directory of Qt source code you downloaded, not from your installed Qt.
                        This is your Qt installation: c:\Qt\Qt5.12.1\5.12.1\mingw73_64\plugins\sqldrivers
                        Look again at the link you posted: c:\Qt\5.10.1\Src\qtbase\src\plugins\sqldrivers is used there (in your case version would be 5.12.1).

                        "'qmake' is not recognized as an internal or external command, operable program or batch file." - use absolute path to qmake.

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

                        S 1 Reply Last reply
                        2
                        • jsulmJ jsulm

                          @Stelian You need to call qmake from the source code directory of Qt source code you downloaded, not from your installed Qt.
                          This is your Qt installation: c:\Qt\Qt5.12.1\5.12.1\mingw73_64\plugins\sqldrivers
                          Look again at the link you posted: c:\Qt\5.10.1\Src\qtbase\src\plugins\sqldrivers is used there (in your case version would be 5.12.1).

                          "'qmake' is not recognized as an internal or external command, operable program or batch file." - use absolute path to qmake.

                          S Offline
                          S Offline
                          Stelian
                          wrote on last edited by Stelian
                          #15

                          @jsulm Thank you for your reply.
                          I have modified the line with this one.c:\Qt\Qt5.12.1\Sources\qtbase\src\plugins\sqldrivers>qmake -- MYSQL_INCDIR=C:\Program Files\MySQL\MySQL Server 8.0\include "MYSQL_LIBDIR=C:\Program Files\MySQL\MySQL Server 8.0\lib" but I get the same error: "qmake' is not recognized as an internal or external command, operable program or batch file"

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

                            Use the full path to the qmake executable or start a Qt enabled command line.

                            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
                            • S Offline
                              S Offline
                              Stelian
                              wrote on last edited by
                              #17

                              Okay, another error.
                              I quit, error after error with QMYSQL driver.
                              I really like Qt, but I have no patience.
                              Thank you anyway for your help, SGaist and jsulm.

                              ERROR: Invalid command line parameter 'Files/MySQL/MySQL'.

                              c:\Qt\Qt5.12.1\Sources\qtbase\src\plugins\sqldrivers>C:\Qt\Qt5.12.1\5.12.1\mingw73_64\bin\qmake -- MYSQL_INCDIR=C:/Program Files/MySQL/MySQL Server 8.0/include "MYSQL_LIBDIR=C:Program Files/MYSQL/MySQL Server 8.0/lib"

                              jsulmJ 1 Reply Last reply
                              0
                              • S Stelian

                                Okay, another error.
                                I quit, error after error with QMYSQL driver.
                                I really like Qt, but I have no patience.
                                Thank you anyway for your help, SGaist and jsulm.

                                ERROR: Invalid command line parameter 'Files/MySQL/MySQL'.

                                c:\Qt\Qt5.12.1\Sources\qtbase\src\plugins\sqldrivers>C:\Qt\Qt5.12.1\5.12.1\mingw73_64\bin\qmake -- MYSQL_INCDIR=C:/Program Files/MySQL/MySQL Server 8.0/include "MYSQL_LIBDIR=C:Program Files/MYSQL/MySQL Server 8.0/lib"

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

                                @Stelian This error is unrelated to Qt: you have a path with spaces (good example for why you should avoid such paths!). You need to put such paths into "":

                                c:\Qt\Qt5.12.1\Sources\qtbase\src\plugins\sqldrivers>C:\Qt\Qt5.12.1\5.12.1\mingw73_64\bin\qmake -- MYSQL_INCDIR="C:/Program Files/MySQL/MySQL Server 8.0/include" MYSQL_LIBDIR="C:Program Files/MYSQL/MySQL Server 8.0/lib"
                                

                                "I have no patience" - well, one should have when developing software...

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

                                J.HilkJ S 2 Replies Last reply
                                2
                                • jsulmJ jsulm

                                  @Stelian This error is unrelated to Qt: you have a path with spaces (good example for why you should avoid such paths!). You need to put such paths into "":

                                  c:\Qt\Qt5.12.1\Sources\qtbase\src\plugins\sqldrivers>C:\Qt\Qt5.12.1\5.12.1\mingw73_64\bin\qmake -- MYSQL_INCDIR="C:/Program Files/MySQL/MySQL Server 8.0/include" MYSQL_LIBDIR="C:Program Files/MYSQL/MySQL Server 8.0/lib"
                                  

                                  "I have no patience" - well, one should have when developing software...

                                  J.HilkJ Offline
                                  J.HilkJ Offline
                                  J.Hilk
                                  Moderators
                                  wrote on last edited by
                                  #19

                                  @jsulm said in Error QMYSQL Plugin on Windows:

                                  "I have no patience" - well, one should have when developing software...

                                  maybe it's a typo and it's supposed to be patients, meaning als patients are gone and there's now more time on hand for developing software

                                  :P


                                  Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                                  Q: What's that?
                                  A: It's blue light.
                                  Q: What does it do?
                                  A: It turns blue.

                                  1 Reply Last reply
                                  1
                                  • jsulmJ jsulm

                                    @Stelian This error is unrelated to Qt: you have a path with spaces (good example for why you should avoid such paths!). You need to put such paths into "":

                                    c:\Qt\Qt5.12.1\Sources\qtbase\src\plugins\sqldrivers>C:\Qt\Qt5.12.1\5.12.1\mingw73_64\bin\qmake -- MYSQL_INCDIR="C:/Program Files/MySQL/MySQL Server 8.0/include" MYSQL_LIBDIR="C:Program Files/MYSQL/MySQL Server 8.0/lib"
                                    

                                    "I have no patience" - well, one should have when developing software...

                                    S Offline
                                    S Offline
                                    Stelian
                                    wrote on last edited by Stelian
                                    #20

                                    @jsulm Thank you for reply!
                                    I,ve run c:\Qt\Qt5.12.1\Sources\qtbase\src\plugins\sqldrivers>C:\Qt\Qt5.12.1\5.12.1\mingw73_64\bin\qmake -- MYSQL_INCDIR="C:/Program Files/MySQL/MySQL Server 8.0/include" MYSQL_LIBDIR="C:Program Files/MYSQL/MySQL Server 8.0/lib"
                                    and I get the next message:

                                    Running configuration tests...
                                    Done running configuration tests.
                                    
                                    Configure summary:
                                    
                                    Qt Sql Drivers:
                                      DB2 (IBM) .............................. no
                                      InterBase .............................. no
                                      MySql .................................. no
                                      OCI (Oracle) ........................... no
                                      ODBC ................................... no
                                      PostgreSQL ............................. no
                                      SQLite2 ................................ no
                                      SQLite ................................. yes
                                        Using system provided SQLite ......... no
                                      TDS (Sybase) ........................... no
                                    
                                    Qt is now configured for building. Just run 'mingw32-make'.
                                    Once everything is built, you must run 'mingw32-make install'.
                                    Qt will be installed into 'C:\Qt\Qt5.12.1\5.12.1\mingw73_64'.
                                    

                                    And I,ve run mingw32-make

                                    'mingw32-make' is not recognized as an internal or external command,
                                    operable program or batch file.

                                    Do I have to add the path to make.exe in environment variables ?
                                    But I don't find de make.exe file.
                                    What else do I have to do ?

                                    jsulmJ 1 Reply Last reply
                                    0
                                    • S Stelian

                                      @jsulm Thank you for reply!
                                      I,ve run c:\Qt\Qt5.12.1\Sources\qtbase\src\plugins\sqldrivers>C:\Qt\Qt5.12.1\5.12.1\mingw73_64\bin\qmake -- MYSQL_INCDIR="C:/Program Files/MySQL/MySQL Server 8.0/include" MYSQL_LIBDIR="C:Program Files/MYSQL/MySQL Server 8.0/lib"
                                      and I get the next message:

                                      Running configuration tests...
                                      Done running configuration tests.
                                      
                                      Configure summary:
                                      
                                      Qt Sql Drivers:
                                        DB2 (IBM) .............................. no
                                        InterBase .............................. no
                                        MySql .................................. no
                                        OCI (Oracle) ........................... no
                                        ODBC ................................... no
                                        PostgreSQL ............................. no
                                        SQLite2 ................................ no
                                        SQLite ................................. yes
                                          Using system provided SQLite ......... no
                                        TDS (Sybase) ........................... no
                                      
                                      Qt is now configured for building. Just run 'mingw32-make'.
                                      Once everything is built, you must run 'mingw32-make install'.
                                      Qt will be installed into 'C:\Qt\Qt5.12.1\5.12.1\mingw73_64'.
                                      

                                      And I,ve run mingw32-make

                                      'mingw32-make' is not recognized as an internal or external command,
                                      operable program or batch file.

                                      Do I have to add the path to make.exe in environment variables ?
                                      But I don't find de make.exe file.
                                      What else do I have to do ?

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

                                      @Stelian Use whole path to mingw-make

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

                                      1 Reply Last reply
                                      0
                                      • S Offline
                                        S Offline
                                        Stelian
                                        wrote on last edited by
                                        #22

                                        I,ve looked foe mingw-make.exe file into C:\Qt\Qt5.12.1\5.12.1\mingw73_64\bin
                                        I don't find it.
                                        Do I have to follow next steps ?

                                        uninstall your current MinGW installation
                                        reinstall MinGW and select the following option in the setup dialog
                                        a) Custom
                                        b) Compilers C & C++
                                        c) MSYS
                                        extend your PATH environment variable in the System Properties / Environment Variables dialog of windows by adding C:\MinGW\msys\1.0\bin;C:\MinGW\bin; in front of the values that are already there
                                        restart machine

                                        jsulmJ 1 Reply Last reply
                                        0
                                        • S Stelian

                                          I,ve looked foe mingw-make.exe file into C:\Qt\Qt5.12.1\5.12.1\mingw73_64\bin
                                          I don't find it.
                                          Do I have to follow next steps ?

                                          uninstall your current MinGW installation
                                          reinstall MinGW and select the following option in the setup dialog
                                          a) Custom
                                          b) Compilers C & C++
                                          c) MSYS
                                          extend your PATH environment variable in the System Properties / Environment Variables dialog of windows by adding C:\MinGW\msys\1.0\bin;C:\MinGW\bin; in front of the values that are already there
                                          restart machine

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

                                          @Stelian It should be in c:\Qt\Tools\mingw730_64\bin

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

                                          S 1 Reply Last reply
                                          1

                                          • Login

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