4
votes

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!

1
I think you should configure mysql's support just before compiling Qt.Basile Starynkevitch
I think this is a duplicate of this question: stackoverflow.com/questions/1530282/…. Not sure if you have ldd tool but you might want to check if the required mysql libraries are in the path.Karlson
Is the mysql.dll in path or next to qsqlmysql.dll?Lars
Thanks for your answers, Karlson you where right, I followed the steps in your link, now it works.user925861
Please, answer your question, so you can check it as answered.tro

1 Answers

1
votes

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)