Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Mysql not defined when compiling mysql driver
Forum Updated to NodeBB v4.3 + New Features

Mysql not defined when compiling mysql driver

Scheduled Pinned Locked Moved Solved Installation and Deployment
39 Posts 3 Posters 5.1k 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.
  • T Offline
    T Offline
    Thombou
    wrote on 20 Apr 2020, 09:43 last edited by
    #20

    I have added the path to vcvarsall.bat in my path and I ran the command bcvarsall.bat amd64. After this, I have nmake in my path so that's ok.

    I deleted the source component and I am making a fresh install now. I will start the compilation of the plugin after that.

    1 Reply Last reply
    0
    • T Offline
      T Offline
      Thombou
      wrote on 20 Apr 2020, 10:52 last edited by Thombou
      #21

      Hi again,
      So, Now i managed to do a proper installation of the plugin I guess. I now have in my C:\Qt\5.14.2\msvc2017_64\plugins\sqldrivers folder the qsqlmysql.dll and qsqlmysqld.dll.

      I put the libmysql.dll in the same directory as my .exe file but I still have the same problem...

      Here is part of the output

      Cannot load library C:\Qt\5.14.2\msvc2017_64\plugins\sqldrivers\qsqlmysqld.dll: The specified module could not be found.
      QLibraryPrivate::loadPlugin failed on "C:/Qt/5.14.2/msvc2017_64/plugins/sqldrivers/qsqlmysqld.dll" : "Cannot load library C:\Qt\5.14.2\msvc2017_64\plugins\sqldrivers\qsqlmysqld.dll: The specified module could not be found."

      However in the directory it looks in I have the file:
      924fd9ac-5583-4f8c-a2b0-d9428487547a-image.png

      1 Reply Last reply
      0
      • M Offline
        M Offline
        MEMekaniske
        wrote on 20 Apr 2020, 11:13 last edited by
        #22

        What if you now do as I have with my dlls, copy them to build where exe is in a folder sqldrivers.

        If that won't work. There should be someone more competent on here that can help.
        Everything seems fine to me regarding paths, versions etc.

        Hope you manage to solve this :)

        1 Reply Last reply
        0
        • T Offline
          T Offline
          Thombou
          wrote on 20 Apr 2020, 11:53 last edited by
          #23

          Same issue...
          Can it be due to the compiler I use? As I mentioned I had to run the vcvarsall.bat file, where I have different options
          0ba9b01d-f30f-41b6-b448-c7e19dd6ee8c-image.png
          I chose amd64 which is the same as the one I use to compile my qt projects.

          1 Reply Last reply
          0
          • M Offline
            M Offline
            MEMekaniske
            wrote on 20 Apr 2020, 12:20 last edited by
            #24

            Everything seems to be right with compiler etc, because you get the ddls placed in the correct directories for the MSCV2017..
            And since you use same architecture type on both builds there should be noe problem there either..

            A quick fix for you is to use these:
            https://github.com/thecodemonkey86/qt_mysql_driver/releases/tag/qmysql_5.14.2

            But I suggest that you also check in on this thread to see if someone has answers leading to a permanent fix for future builds.
            Or you can try the process again with mingw and see if that gives the same output etc, then at least you know if the environment for mscv is correct if the outputs are the same.

            T 1 Reply Last reply 20 Apr 2020, 12:32
            1
            • M MEMekaniske
              20 Apr 2020, 12:20

              Everything seems to be right with compiler etc, because you get the ddls placed in the correct directories for the MSCV2017..
              And since you use same architecture type on both builds there should be noe problem there either..

              A quick fix for you is to use these:
              https://github.com/thecodemonkey86/qt_mysql_driver/releases/tag/qmysql_5.14.2

              But I suggest that you also check in on this thread to see if someone has answers leading to a permanent fix for future builds.
              Or you can try the process again with mingw and see if that gives the same output etc, then at least you know if the environment for mscv is correct if the outputs are the same.

              T Offline
              T Offline
              Thombou
              wrote on 20 Apr 2020, 12:32 last edited by Thombou
              #25

              @MEMekaniske Thanks a lot! That works now.
              It turns out that it is my libmysql.dll file that was not working.
              I did different test and I figured out that if I just replace this file by the one provided in the link and keeping all other dll as I built them, it works.
              I found my libmysql.dll file in the installation folder of my mysql server C:\Program Files\MySQL\MySQL Server 8.0. Any idea of what could be wrong about this one?

              K 1 Reply Last reply 20 Apr 2020, 12:47
              0
              • M Offline
                M Offline
                MEMekaniske
                wrote on 20 Apr 2020, 12:45 last edited by
                #26

                That is good :)

                Ok, only thing I can think of then is that the MySQL Server 8.0 installed is for a different architecture and cannot be used with amd64, maybe if you just download and install the versions that can be installed on your architecture and try with each of them to see if there is any difference.

                If not, I guess it is a bug for the mysql community/support to take a look at

                1 Reply Last reply
                2
                • T Thombou
                  20 Apr 2020, 12:32

                  @MEMekaniske Thanks a lot! That works now.
                  It turns out that it is my libmysql.dll file that was not working.
                  I did different test and I figured out that if I just replace this file by the one provided in the link and keeping all other dll as I built them, it works.
                  I found my libmysql.dll file in the installation folder of my mysql server C:\Program Files\MySQL\MySQL Server 8.0. Any idea of what could be wrong about this one?

                  K Offline
                  K Offline
                  kshegunov
                  Moderators
                  wrote on 20 Apr 2020, 12:47 last edited by
                  #27

                  @Thombou said in Mysql not defined when compiling mysql driver:

                  I did different test and I figured out that if I just replace this file by the one provided in the link and keeping all other dll as I built them, it works.

                  Did you check that the arch matches between the plugin and the client library? I'd hazard a guess that's what was wrong. Anyway, as you have it solved it wouldn't matter that much.

                  Read and abide by the Qt Code of Conduct

                  T 1 Reply Last reply 20 Apr 2020, 14:11
                  0
                  • K kshegunov
                    20 Apr 2020, 12:47

                    @Thombou said in Mysql not defined when compiling mysql driver:

                    I did different test and I figured out that if I just replace this file by the one provided in the link and keeping all other dll as I built them, it works.

                    Did you check that the arch matches between the plugin and the client library? I'd hazard a guess that's what was wrong. Anyway, as you have it solved it wouldn't matter that much.

                    T Offline
                    T Offline
                    Thombou
                    wrote on 20 Apr 2020, 14:11 last edited by
                    #28

                    @kshegunov What do you call the client library? The libmysql.dll?

                    K 1 Reply Last reply 20 Apr 2020, 14:12
                    0
                    • T Thombou
                      20 Apr 2020, 14:11

                      @kshegunov What do you call the client library? The libmysql.dll?

                      K Offline
                      K Offline
                      kshegunov
                      Moderators
                      wrote on 20 Apr 2020, 14:12 last edited by
                      #29

                      @Thombou said in Mysql not defined when compiling mysql driver:

                      What do you call the client library? The libmysql.dll?

                      Yes!

                      Read and abide by the Qt Code of Conduct

                      T 1 Reply Last reply 20 Apr 2020, 14:22
                      0
                      • K kshegunov
                        20 Apr 2020, 14:12

                        @Thombou said in Mysql not defined when compiling mysql driver:

                        What do you call the client library? The libmysql.dll?

                        Yes!

                        T Offline
                        T Offline
                        Thombou
                        wrote on 20 Apr 2020, 14:22 last edited by Thombou
                        #30

                        @kshegunov I downloaded it from here https://dev.mysql.com/downloads/windows/installer/8.0.html.
                        As it is installed in the Program Files and not the Program Files (x86) directory I'd say it's 64bits...
                        Plus, this is what I installed so:
                        4dec0bb9-2b74-4299-b658-851e8881cc69-image.png

                        M 1 Reply Last reply 20 Apr 2020, 14:31
                        0
                        • T Thombou
                          20 Apr 2020, 14:22

                          @kshegunov I downloaded it from here https://dev.mysql.com/downloads/windows/installer/8.0.html.
                          As it is installed in the Program Files and not the Program Files (x86) directory I'd say it's 64bits...
                          Plus, this is what I installed so:
                          4dec0bb9-2b74-4299-b658-851e8881cc69-image.png

                          M Offline
                          M Offline
                          MEMekaniske
                          wrote on 20 Apr 2020, 14:31 last edited by
                          #31

                          @Thombou It says X64 under the architecture tab so should be the correct version.

                          1 Reply Last reply
                          1
                          • M Offline
                            M Offline
                            MEMekaniske
                            wrote on 20 Apr 2020, 14:35 last edited by
                            #32

                            Also, if you go into the "Add" tab, then expand MySQL Servers, then expand MySQL Server, then choose MySQL Server 8.0 you get the option to choose the availiable architectures :)

                            1 Reply Last reply
                            0
                            • T Offline
                              T Offline
                              Thombou
                              wrote on 20 Apr 2020, 15:41 last edited by
                              #33

                              Yes that's what I di not understand. it seems that I have the correct version but a wrong version of the libmysql.dll... Anyway, i hope that it is fixed now, and that I won't have other surprises like that later on.
                              Thank you very much for your help! It is much appreciated!

                              M 1 Reply Last reply 20 Apr 2020, 16:03
                              1
                              • T Thombou
                                20 Apr 2020, 15:41

                                Yes that's what I di not understand. it seems that I have the correct version but a wrong version of the libmysql.dll... Anyway, i hope that it is fixed now, and that I won't have other surprises like that later on.
                                Thank you very much for your help! It is much appreciated!

                                M Offline
                                M Offline
                                MEMekaniske
                                wrote on 20 Apr 2020, 16:03 last edited by
                                #34

                                @Thombou Yeah it is very frustrating.. hope all goes well with the next version!
                                Glad i could help :)

                                1 Reply Last reply
                                1
                                • T Offline
                                  T Offline
                                  Thombou
                                  wrote on 21 Apr 2020, 08:55 last edited by
                                  #35

                                  Shall I report a bug somewhere of shall I suppose the problem is on my side?

                                  K 1 Reply Last reply 21 Apr 2020, 09:33
                                  1
                                  • T Thombou
                                    21 Apr 2020, 08:55

                                    Shall I report a bug somewhere of shall I suppose the problem is on my side?

                                    K Offline
                                    K Offline
                                    kshegunov
                                    Moderators
                                    wrote on 21 Apr 2020, 09:33 last edited by
                                    #36

                                    @Thombou said in Mysql not defined when compiling mysql driver:

                                    Shall I report a bug somewhere of shall I suppose the problem is on my side?

                                    The latter. (And don't feel bad, it happens all the time, that's why this user forum exists)

                                    Read and abide by the Qt Code of Conduct

                                    T 1 Reply Last reply 21 Apr 2020, 13:50
                                    1
                                    • K kshegunov
                                      21 Apr 2020, 09:33

                                      @Thombou said in Mysql not defined when compiling mysql driver:

                                      Shall I report a bug somewhere of shall I suppose the problem is on my side?

                                      The latter. (And don't feel bad, it happens all the time, that's why this user forum exists)

                                      T Offline
                                      T Offline
                                      Thombou
                                      wrote on 21 Apr 2020, 13:50 last edited by
                                      #37

                                      @kshegunov Ok that's what I thought too :) haha. It's by doing that we learn!
                                      Cheers :)

                                      1 Reply Last reply
                                      0
                                      • T Offline
                                        T Offline
                                        Thombou
                                        wrote on 22 Apr 2020, 08:52 last edited by Thombou
                                        #38

                                        For those who are interested, I opened the 2 dlls with the dependancy walker. It turns out that the dll provided by mysqlserver required 2 additional dlls LIBSSL-1_1X64.DLL and LIBCRYPTO-1_1-x64.DLL which were not found. In the dll file that if working, those 2 additional dlls are not required. When placing those 2 DLLs in the folder of the executable everything works perfectly. This is the root cause of the problem.

                                        M 1 Reply Last reply 22 Apr 2020, 08:59
                                        1
                                        • T Thombou
                                          22 Apr 2020, 08:52

                                          For those who are interested, I opened the 2 dlls with the dependancy walker. It turns out that the dll provided by mysqlserver required 2 additional dlls LIBSSL-1_1X64.DLL and LIBCRYPTO-1_1-x64.DLL which were not found. In the dll file that if working, those 2 additional dlls are not required. When placing those 2 DLLs in the folder of the executable everything works perfectly. This is the root cause of the problem.

                                          M Offline
                                          M Offline
                                          MEMekaniske
                                          wrote on 22 Apr 2020, 08:59 last edited by
                                          #39

                                          @Thombou very helpful information indeed! :)

                                          What if you download those dlls to your exe lib and (there you did it already in the edit I see :p) hehe..

                                          Very good, then you have complied the library successfully! Congratz :)

                                          1 Reply Last reply
                                          0

                                          29/39

                                          20 Apr 2020, 14:12

                                          • Login

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