[SOLVED] QSqlDatabase: QMYSQL driver not loaded



  • Dear all,

    I followed these steps to build QMYSQL driver:

    @cd %QTDIR%\src\plugins\sqldrivers\mysql
    qmake "INCLUDEPATH+=C:\MySQL\include" "LIBS+=C:\MYSQL\lib\libmysql.lib" mysql.pro
    nmake
    copy C:\MYSQL\lib\libmysql.dll %QTDIR%\bin@

    But I still got the error:
    QSqlDatabase: QMYSQL driver not loaded

    Could you please help me how to fix this issue?



  • Has the resulting library been placed in the plugins/sqldrivers directory?



  • Dear Lukas Geyer,

    Yes, the following files are modified in /plugins/sqldrivers directory:

    • qsqlmysql.lib
    • qsqlmysql.prl

    Are there any files I miss?

    Thank you for your response.

    [quote author="Lukas Geyer" date="1343370474"]Has the resulting library been placed in the plugins/sqldrivers directory?[/quote]



  • qsqlmysql4.dll resp. qsqlmysql4d.dll



  • Dear Lukas Geyer,

    Thank you for your instruction.
    This issue is solved now.

    I guess I use wrong "include & lib" path with MySQL Server,
    I change to use Connector C (Client?) "include & lib" path and do the same like before.
    Now, I can use QMYSQL.

    Thank you very much.

    [quote author="Lukas Geyer" date="1343374724"]qsqlmysql4.dll resp. qsqlmysql4d.dll[/quote]



  • You're welcome.

    And just for the sake of beeing a nitpick: there is a typo in your -[SLOVED]- [SOLVED].


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.