4

After reading this tutorial http://www.pikopong.com/blog/2011/07/11/how-to-enable-mysql-support-in-qt-sdk-for-windows-part-2/ I was able to successfully built the mysql lib for Qt. But somehow it is not listed in the available drivers list, although I copied the files in the right directory.

This is how my Qt-plugins\sqldrivers directory looks like now :

C:\QtSDK\Desktop\Qt\4.8.0\mingw\plugins\sqldrivers

  • libqsqlite4.a
  • libqsqlited4.a
  • libqsqlmysql4.a
  • libqsqlmysqld4.a
  • libqsqlodbc4.a
  • libqsqlodbcd4.a
  • qsqlite4.dll
  • qsqlited4.dll
  • qsqlmysql4.dll
  • qsqlmysqld4.dll
  • qsqlodbc4.dll
  • qsqlodbcd4.dll

And this is what QSqlDatabase::drivers() say :

("QSQLITE", "QODBC3", "QODBC")

Is there something essential missing? Thank you for your help in advance and happy holidays!

  • I think you should configure mysql's support just before compiling Qt. – Basile Starynkevitch Dec 23 '11 at 16:13
  • 1
    I think this is a duplicate of this question: http://stackoverflow.com/questions/1530282/qt-mysql-connectivity-using-windows-xp-qt-creator-4-5-2windows-32-bit. Not sure if you have `ldd` tool but you might want to check if the required mysql libraries are in the path. – Karlson Dec 23 '11 at 16:49
  • 1
    Is the mysql.dll in path or next to qsqlmysql.dll? – Lars Dec 24 '11 at 06:44
  • Thanks for your answers, Karlson you where right, I followed the steps in your link, now it works. –  Dec 26 '11 at 15:21
  • Please, answer your question, so you can check it as answered. – NG_ Mar 03 '13 at 23:16

1 Answers1

1

I solved the problem by following the instructions in this guide: http://christopher.rasch-olsen.no/2009/04/14/qt-45-and-mysql-plugin-with-mingw-on-windows-xp/ This was posted as a solution to the same problem (See Karlson's comment)