Set this variable to a non-zero value in the environment from which your application is launched. This might help you to find the cause of the problem.
![qt mysql driver not loaded qt mysql driver not loaded](https://i.ytimg.com/vi/r1TbNjJSlX8/hq720.jpg)
If the plugin fails to load, then in order to get information from Qt about the loading of the plugin, you can use the QT_DEBUG_PLUGINS environment variable. To make this happen, you can list it in your global PATH in Control Panel/System/Advanced System Settings/Environment variables or put libmysql.dll in the same folder as the Qt dlls in yourQtDirectory/bin. Libmysql.dll needs to be located somewhere where it can be found by the application. Make sure you have built your application, Qt and your plugin with the same configuration (i.e. If the qsqlmysql4 files don't exist under, yourQtVersion/plugins/sqldrivers, then you need to build them by going to yourQtVersion/SRC/plugins/sqldrivers/mysql and typingĪlso, everything needs to have the same configuration. Then you need to check that the qsqlmysql4 files exist under yourQtVersion/plugins/sqldrivers.
#Qt mysql driver not loaded windows#
This article describes the steps that must be taken for your MySQL driver to be loaded by an application on Windows when using the Visual Studio compiler.įirst of all, you need to make sure you have the client MySQL libraries installed on your machine and that your INCLUDEPATH and LIB environment variables are set up correctly so that the headers and lib files can be found.
![qt mysql driver not loaded qt mysql driver not loaded](https://diennvblog.files.wordpress.com/2018/02/running1.png)