MySql driver for Qt 5.1 on Windows
-
I have read a lot of posts but a lot of them concern Linux, I tried to find some files to compile them in dll but I don't now where to find them on my system. Need help, guys.
-
Hello Giperboloid,
I assume that you have Windows OS, right?
-
Hi and welcome to devnet,
If you don't find files to compile it generally means that you don't have the sources installed.
-
You can install QT 5.2 MinGW, MySql driver is there and don't need to be compiled.
-
[quote author="Ever" date="1387741182"]Hello Giperboloid,
I assume that you have Windows OS, right?[/quote]
Yepp, I have Windows.
[quote author="Ever" date="1387744574"]You can install QT 5.2 MinGW, MySql driver is there and don't need to be compiled.[/quote]If it's true today I will have good day ;)
-
[quote author="SGaist" date="1387744319"]Hi and welcome to devnet,
If you don't find files to compile it generally means that you don't have the sources installed.[/quote]
So where I can find these source files and will installation of Qt 5.2 solve all my problems with mysql drivers?
-
Here you can download
"Qt 5.2.0 for Windows 32-bit MinGW 4.8, OpenGL":http://download.qt-project.org/official_releases/qt/5.2/5.2.0/qt-windows-opensource-5.2.0-mingw48_opengl-x86-offline.exeI suggest you that you remove previous installation of Qt by running MaintenanceTool.exe
-
[quote author="Ever" date="1387795692"]Here you can download
"Qt 5.2.0 for Windows 32-bit MinGW 4.8, OpenGL":http://download.qt-project.org/official_releases/qt/5.2/5.2.0/qt-windows-opensource-5.2.0-mingw48_opengl-x86-offline.exeI suggest you that you remove previous installation of Qt by running MaintenanceTool.exe[/quote]
What do you mean? I didn't use this maintenance tool and even didn't remove my Qt 5.1.
-
It is optional.
-
Ok, I just have installed Qt 5.2 with all sources. I have such connection:
@QSqlDatabase lib = QSqlDatabase::addDatabase("QMYSQL");@
and the output is:@QSqlDatabase: QMYSQL driver not loaded
QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7@very intresting thing: driver is available but not loaded.
-
Do you have MySql installed ? If so, is the folder containing the MySql dlls in your PATH environment variable ?
-
Emm... It's Windows, about what PATH you are talking?
-
Indeed, the PATH environment variable that is used to find the executables/dlls on one's system
-
Ok, how I can check this variable?
-
Look in the run panel from Qt Creator
-
bq. very intresting thing: driver is available but not loaded
You can copy file libmysql.dll from C:\Program Files\MySQL\MySQL Server 5.6\lib (absolute path on my computer), to debug and/or release folder of our project.
-
Sorry, nothing haven't help me so I decided to choose SQLite. Thanks for answers.