QMYSQL driver not loaded
-
In QT Creator go to projects on the left side(wrench) and click on it(make sure your in debug). Then under build/build environment add the variable QT_DEBUG_PLUGINS and set it to 1.
Then run again and read the plugin trace and see where it is looking for libmysql.dll and put it there. And make sure you do what @Bonnie said.
--James
-
In QT Creator go to projects on the left side(wrench) and click on it(make sure your in debug). Then under build/build environment add the variable QT_DEBUG_PLUGINS and set it to 1.
Then run again and read the plugin trace and see where it is looking for libmysql.dll and put it there. And make sure you do what @Bonnie said.
--James
What is your qt version or which toolkit you are using ?
And which mysql version you are using ? -
-
Can you open your
qsqlmysql.dll
andlibmysql.dll
with the dependancy walker to make sure all dependancies are found? In my case the libmysql.dll needed 2 additional dlls (I took it from the MySql Server 8.0).If you built the driver yourself and installed is according to the documentation (not only compiling), you should not need to copy the
qsqlmysql.dll
file to the folder \Qt\5.14.2\mingw73_32\plugins\sqldrivers. It should be done during the installation, if I am not wrong. -
I had brutally copied qsqlmysql.dll into sqldriver.
I just built the plugin as explained here (https://doc.qt.io/qt-5/sql-driver.html) and it works perfectly.Thank you all
-
What is your qt version or which toolkit you are using ?
And which mysql version you are using ?@Ketan__Patel__0011 What is your qt version or which toolkit you are using ?
And which mysql version you are using ?I am using 5.9.9 and I do not have mysql(connecting to a remote server), I just downloaded the connector 6.1 I think that has the libs already built.
--James
-
@Ketan__Patel__0011 What is your qt version or which toolkit you are using ?
And which mysql version you are using ?I am using 5.9.9 and I do not have mysql(connecting to a remote server), I just downloaded the connector 6.1 I think that has the libs already built.
--James
Copy libmysql.dll into your <QTDIR>bin
Copy libmysql.dll into this Path : C:\Windows\System32
Copy libmysql.dll into this Path : C:\WindowsSet The Environment Variable PATH :
C:\Program Files\MySQL\MySQL Server 5.6\include
C:\Program Files\MySQL\MySQL Server 5.6\lib
-
Hello! Did you build qsqlmysql.dll yourself?
And if your libmysql.dll is from MySQL Connector/C 6.1, you'll need VS2015 runtime installed on your machine. -
@Bonnie About the deployment I put libmysql.dll (from MySQL Connector / C 6.1) in the folder containing the exe. Does VS2015 runtime need to be installed on each device? To avoid this, can I take the library from other sources?
@AndreaCT Yes, you can use older versions that has no dependency on VS runtimes. Just check the dll with dependency walker.
EDITED
Actually as I checked, VS runtimes are necessary since 6.1.10.
I think you can try MySQL Connector/C version 6.1.9 or 6.1.6