More MySql issues.
-
Greetings everyone,
After a break from coding I decided to hit it again. I did a fresh install of Qt6 on Windows 10 pro. I am using 6.4.2. I have both MinGW and MS2019 Kits installed for this project. I have downloaded MySQL Server 8.0 (8.0.32 to be exact) installed it and compiled it for both MSVC and MinGW following various Guides. It seams to have completed and installed the libraries without issues. When I try to run the program I get this error.
QSqlDatabase: QMYSQL driver not loaded QSqlDatabase: available drivers: QSQLITE QMARIADB QMYSQL QODBC QPSQL
Looking at all the references both here and the internet trying various things to fix it nothing seems to help. I ran it through dependency walker with the following outcome.
Not quite sure where to go from here. Last time I set it up was the 5.2 days with the C connecter that just worked.
Thanks
-
Greetings everyone,
After a break from coding I decided to hit it again. I did a fresh install of Qt6 on Windows 10 pro. I am using 6.4.2. I have both MinGW and MS2019 Kits installed for this project. I have downloaded MySQL Server 8.0 (8.0.32 to be exact) installed it and compiled it for both MSVC and MinGW following various Guides. It seams to have completed and installed the libraries without issues. When I try to run the program I get this error.
QSqlDatabase: QMYSQL driver not loaded QSqlDatabase: available drivers: QSQLITE QMARIADB QMYSQL QODBC QPSQL
Looking at all the references both here and the internet trying various things to fix it nothing seems to help. I ran it through dependency walker with the following outcome.
Not quite sure where to go from here. Last time I set it up was the 5.2 days with the C connecter that just worked.
Thanks
As you can clearly see libmysql.dll is missing in your PATH (Qt6SQLd and QT6COREd are already loaded when the plugin gets loaded so this can be ignored here).
-
As you can clearly see libmysql.dll is missing in your PATH (Qt6SQLd and QT6COREd are already loaded when the plugin gets loaded so this can be ignored here).
@Christian-Ehrlicher said in More MySql issues.:
As you can clearly see libmysql.dll is missing in your PATH (Qt6SQLd and QT6COREd are already loaded when the plugin gets loaded so this can be ignored here).
I forgot to mention that I have placed the libmysql.dll files in the applications build folder per the instructions. They have also been placed within the lib files of the compiler as well.
-
@Christian-Ehrlicher said in More MySql issues.:
As you can clearly see libmysql.dll is missing in your PATH (Qt6SQLd and QT6COREd are already loaded when the plugin gets loaded so this can be ignored here).
I forgot to mention that I have placed the libmysql.dll files in the applications build folder per the instructions. They have also been placed within the lib files of the compiler as well.
@Chrisw01 said in More MySql issues.:
They have also been placed within the lib files of the compiler as well.
Why? What should this help?
I don't know where you put them, the important thing is that the libmysql.dll is found when the application is run - so adjust your PATH accordingly. And don't mix MSVC and MinGW libs & plugins.
-
@Chrisw01 said in More MySql issues.:
They have also been placed within the lib files of the compiler as well.
Why? What should this help?
I don't know where you put them, the important thing is that the libmysql.dll is found when the application is run - so adjust your PATH accordingly. And don't mix MSVC and MinGW libs & plugins.
@Christian-Ehrlicher said in More MySql issues.:
@Chrisw01 said in More MySql issues.:
They have also been placed within the lib files of the compiler as well.
Why? What should this help?
I don't know where you put them, the important thing is that the libmysql.dll is found when the application is run - so adjust your PATH accordingly. And don't mix MSVC and MinGW libs & plugins.
Honestly, I have been fighting this problem all week. Reading blog after blog after blog. I did not mix up the libraries. I followed MSVC instructions for MSVC and MinGW instructions for it. The problem appears to be where to place the libmysql.dll file so it can be seen within Qt Creator while I Develop. I know it needs to be in the application folder when you distribute. Previously placing the libmysql.dll file within the applications build folder satisfied this apparently not anymore. I managed to find a fix however. I added created a folder and placed the required files there. Then I added LIBS += -L"C:\MySql" -lmysql to my project file and the program now works. May or may not be the proper way to do it but it works. I have not had to do this in the past but again, I've taken a break from Qt for a while and things may have changed.
Thanks for your help..
-