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 Deployment fails to load driver.
Forum Updated to NodeBB v4.3 + New Features

MySQL Deployment fails to load driver.

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 254 Views
  • 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.
  • J Offline
    J Offline
    James Hankins
    wrote on last edited by
    #1

    I've been going through a seeming gauntlet to get a simple MySQL connection going with a project I'm working on. I'm new to Qt. This forum has been very helpful getting me this far.

    My current problem is a deployment to Windows that includes a MySQL driver built as a plugin and working (finally) on the development workstation. It connects fine there.

    I used winqtdeploy to create the bundle. I enabled debugging on the station I deployed the bundle to: I get:
    [1776] Cannot load library C:\Program Files\QtDBTest\sqldrivers\qsqlmysql.dll: The specified module could not be found.

    The file is there. It has Read/Execute permissions. Am I missing something here?

    Connection fails due to driver.

    Contents of the directory:

    libmysql.dll
    qsqlite.dll
    qsqlmysql.dll
    qsqlodbc.dll
    sqslsql.dll
    
    1 Reply Last reply
    0
    • J Offline
      J Offline
      James Hankins
      wrote on last edited by
      #4

      I just tried copying the .dll's from a MySQL C++ 8.0 Connector install into the .exe's folder and it works now. These never get mentioned in Dependency Walker. Confusing process to be sure.

      1 Reply Last reply
      0
      • Christian EhrlicherC Online
        Christian EhrlicherC Online
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #2

        Use Dependency Walker or similar tools to see what dlls qsqlmysql.dll needs on the deployed machine. Setting QT_DEBUG_PLUGINS on the command line and running the program from there can also help.

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        1 Reply Last reply
        3
        • J Offline
          J Offline
          James Hankins
          wrote on last edited by James Hankins
          #3

          I looked at dependency walker and it seems satisfied for qsqlmysql.dll and all top level dependencies. I had already set the QT_DEBUG_PLUGINS env variable which is how I got the error stating:

          [1776] Cannot load library C:\Program Files\QtDBTest\sqldrivers\qsqlmysql.dll: The specified module could not be found.
          

          That's one of the confusing parts. The file is there. The executable is in C:\Program Files\QtDBTest and the sqldrivers is a subdirectory which is what windeployqt created.

          I've had other people tell me to move the files next to the .exe. That has not worked either. I've had people tell me it needs to be in the path. That didn't work either.

          I've tried more than 1 machine to rule out anything specific with that host.

          I should add that I used the following process listed in this thread to build the plugin using MSVS 2017 Native 64 Prompt.

          1 Reply Last reply
          0
          • J Offline
            J Offline
            James Hankins
            wrote on last edited by
            #4

            I just tried copying the .dll's from a MySQL C++ 8.0 Connector install into the .exe's folder and it works now. These never get mentioned in Dependency Walker. Confusing process to be sure.

            1 Reply Last reply
            0
            • Christian EhrlicherC Online
              Christian EhrlicherC Online
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on last edited by
              #5

              Please take a new try - use the stuff from windeploy but move the libmysql.dll from the sqldrivers subdir directly in the executable folder and try again.

              Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
              Visit the Qt Academy at https://academy.qt.io/catalog

              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