How to get working Qt mysql driver???
-
wrote on 18 Jul 2012, 21:20 last edited by
Hi everyone.
I got this error when I run the project:QSqlDatabase: QMYSQL driver not loaded
QSqlDatabase: available drivers: QSQLITE QODBC3 QODBCI've done many things but no positive results. Anyone knows a trick?
Thanks for reading this.P.D. I'm using MacOS
-
wrote on 19 Jul 2012, 04:08 last edited by
Hi
Your mysql driver not installed on your system.
Download and install it,then try againif you have problem for install it, search on this forum for similar topics. ;)
-
wrote on 19 Jul 2012, 09:43 last edited by
The MySql driver does not come build with your Qt SDK installation for licencing reasons. You will have to build it yourself. There are plenty of topics here on Qt Devnet and elsewhere on the net available on how to do it. You will need to get the Qt sources to do it though, and the MySql SDK.
-
wrote on 19 Jul 2012, 11:18 last edited by
Hi, i successeded to make it work i had explain how in this post, and if it dosen't work just send me a private msg(sorry my english is very bad). http://qt-project.org/forums/viewthread/18828/
-
wrote on 19 Jul 2012, 16:42 last edited by
OK, thanks! I'm looking it right now. (my english it's worse)
I'll post results later. -
wrote on 19 Jul 2012, 21:21 last edited by
Ok, I've done this:
-> Download Qt sources
-> Follow this steps :
http://qt-project.org/doc/qt-4.8/sql-driver.html#qmysqlBut after:
$qmake "INCLUDEPATH+=/usr/local/mysql/include" "LIBS+=-L/usr/local/mysql/lib -lmysqlclient_r" mysql.pro // Edited to set the real path$make // Returns:
->make: *** No targets specified and no makefile found. Stop.$ls -l output:
-rwxrwxrwx 1 dunix staff 204 Apr 26 15:46 README
-rwxrwxrwx 1 dunix staff 2571 Apr 26 15:46 main.cpp
-rwxrwxrwx 1 dunix staff 122 Apr 26 15:46 mysql.pro
drwxrwxrwx 5 dunix staff 315 Jul 19 16:45 qsqlmysql_debug.xcodeprojWhat should I do now?
Thanks everyone. -
wrote on 23 Jul 2012, 16:33 last edited by
I got everything working now. I've compiled the sources following Andre s advice.
Thanks
3/7