Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Solved build QMYSQL driver under windows 10, a sample solution for QSqlDatabase: QMYSQL driver not loaded

    General and Desktop
    8
    18
    3651
    Loading More Posts
    • 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.
    • JonB
      JonB @Christian Ehrlicher last edited by JonB

      @Christian-Ehrlicher
      I shall blame whomever I choose to blame! ;)

      I just had a look at my Ubuntu 19.04. I fetched everything Qt, including the MySQL bits, via apt-get only, no sources/compilation. I see that OS release comes with Qt 5.12.2. You are saying that once I move to the next release of Ubuntu I will have to follow instructions to get sources and compile for MySQL interoperability? And for stinky Windows, I will have to muck about fetching & installing a C++ compiler? You sure about this? :( This applies to both Linux & Windows? Are you able to supply a link mentioning this for Qt 5.12.6 onward. please?

      1 Reply Last reply Reply Quote 0
      • Christian Ehrlicher
        Christian Ehrlicher Lifetime Qt Champion last edited by

        I'm pretty sure ubuntu will ship the mysql plugin also for Qt > 5.12.5 but the pre-compiled Qt you're getting with the Qt installer will no longer ship this plugin due to legal reasons.

        Qt has to stay free or it will die.

        JonB 1 Reply Last reply Reply Quote 2
        • JonB
          JonB @Christian Ehrlicher last edited by

          @Christian-Ehrlicher
          Ahhhh! Fortunately I have never used the Qt installer, so hopefully I can breathe a sigh of relief over this :) I sit in Ubuntu, I can't even recall what I did to install Qt under Windoze :)

          1 Reply Last reply Reply Quote 0
          • H
            hehedaozuiteng @Christian Ehrlicher last edited by hehedaozuiteng

            @Christian-Ehrlicher
            hi, I try to follow the step of the link your showed. But there is no "Libs & Include Files" Module in mysql "Custom Install", and no file end with the /lib/opt in any my sql file.

            I tried the following code on cmd, but nothing work.
            cd C:\Qt\5.12.6\mingw73_32\bin\ (where qmake is )
            qmake -- MYSQL_INCDIR=E:/mysql-8.0.18-winx64/include "MYSQL_LIBDIR=C:/Program Files/MySQL/MySQL Server 8.0/lib"

            there is nothing happened.

            1 Reply Last reply Reply Quote 0
            • H
              hehedaozuiteng @mvsri last edited by

              @mvsri

              I put the libmysql.dll in QT bin before the posted, but not work. thank you for you help.

              1 Reply Last reply Reply Quote 0
              • Christian Ehrlicher
                Christian Ehrlicher Lifetime Qt Champion last edited by

                @hehedaozuiteng said in QMYSQL driver not loaded, how to get the qsqlmysql.dll for qt5.12.6 ?:

                I tried the following code on cmd, but nothing work.

                I'm giving up - you simply don't care about the instructions and don't show us what we need to show and what we suggest you to do... why do you think anything will work inside C:\Qt\5.12.6\mingw73_32\bin\ when you want to compile the sql driver? Did you make sure the incdir and libdir are containing the files mentioned in my (second) instruction link?

                Qt has to stay free or it will die.

                H 2 Replies Last reply Reply Quote 0
                • H
                  hehedaozuiteng @Christian Ehrlicher last edited by hehedaozuiteng

                  @Christian-Ehrlicher
                  Do not be mad man. I just not realize how to build sql-driver.
                  the cmd does not running the qmake, I do not install qmake before I used it so I though I have to move to the where qmake.exe is.
                  Now I am install the qmake, perhep this time work and reinstall the mysql. Mysql is combine into differents programs, I cannot find the include and "/lib/opt" folder in it.

                  1 Reply Last reply Reply Quote 0
                  • H
                    hehedaozuiteng @Christian Ehrlicher last edited by hehedaozuiteng

                    @Christian-Ehrlicher

                    Can you tell me what is the file that include in the "incdir" and "libdir" folder ?
                    I reinstalled the mysql, but cannot find the folder such as your described in instruction. Thank you very much.

                    1 Reply Last reply Reply Quote 0
                    • T
                      thecodemonkey last edited by

                      in the hope i can help someone: I provide various versions of qsqlmysql.dll here on Github

                      H C 2 Replies Last reply Reply Quote 0
                      • H
                        hehedaozuiteng @thecodemonkey last edited by hehedaozuiteng

                        @thecodemonkey
                        Thank for you help anyway.
                        I solved it two days ago. BTW, I do not think 32 bit vision is useful, ( if I am wrong please point out.) Mysql's serves is only offer 64 bit, so the libmysql.dll is also 64 bits. That is why I cannot build the drive at first 2 days lol.

                        If someone like me do not know this, he will kill his two days beautiful life XD.

                        1 Reply Last reply Reply Quote 0
                        • M
                          Malibob last edited by

                          When I run this "qmake -- MYSQL_INCDIR="%Mysql%/MySQL Server 8.0/include" MYSQL_LIBDIR="%Mysql%/MySQL Server 8.0/lib" " it's show me the message " QMake has two modes, one mode for generating project files based on some heuristics, and the other for generating makefiles. Normally you shouldn't need to specify a mode, as makefile generation is the default mode for qmake, but you may use this to test qmake on an existing project " How can i solve this?

                          1 Reply Last reply Reply Quote 0
                          • C
                            Camilo Quijano @thecodemonkey last edited by

                            @thecodemonkey Thank you so much. Your files solved my problem.

                            1 Reply Last reply Reply Quote 0
                            • terma.aba
                              terma.aba last edited by

                              This post is deleted!
                              1 Reply Last reply Reply Quote 0
                              • First post
                                Last post