Results 1 to 2 of 2

Thread: QMYSQL driver not loaded

  1. #1
    Join Date
    Oct 2011
    Location
    Florence - Italy
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Question QMYSQL driver not loaded

    Hi all,

    I have a problem with the mysql driver plugin.
    I use Qt 4.7.4, MSVC 2008 and Windows 7 - 64 bit.

    Source code is:

    db = QSqlDatabase::addDatabase("QMYSQL");

    Error code is:
    Failed to connect to the database
    Driver not loaded

    Available drivers:

    QSQLITE
    QODBC3
    QODBC

    I tried to use both the 32 and 64 bit version of the libmysql.dll without success.

    Available plugins in the plugins folder are:
    C:\QtSDK\Desktop\Qt\4.7.4\msvc2008\plugins\sqldriv ers>dir *.dll
    Il volume nell'unità C è Disco locale
    Numero di serie del volume: BAB5-C1FD

    Directory di C:\QtSDK\Desktop\Qt\4.7.4\msvc2008\plugins\sqldriv ers

    14/11/2011 12:48 4.208.128 libmysql.dll
    23/08/2011 16:07 416.256 qsqlite4.dll
    23/08/2011 16:07 613.888 qsqlited4.dll
    06/12/2011 15:51 58.880 qsqlmysql4.dll
    06/12/2011 15:51 120.320 qsqlmysqld4.dll
    23/08/2011 16:07 88.576 qsqlodbc4.dll
    23/08/2011 16:07 162.304 qsqlodbcd4.dll
    23/08/2011 17:01 119.808 qsqlpsql4.dll
    23/08/2011 17:01 229.888 qsqlpsqld4.dll
    9 File 6.018.048 byte
    0 Directory 14.270.353.408 byte disponibili

    The mysql plugin seems well compiled to me. What i did is:

    QMAKESPEC=C:\QtSDK\Desktop\Qt\4.7.4\msvc2008\mkspe cs\win32-msvc2008

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

    and i got qsqlmysql4.dll and qsqlmysqld4.dll

    qsqlmysqld4.dll exported function are (using dll export viewer)
    qt_plugin_instance 0x1000126c 0x0000126c 1 (0x1) qsqlmysqld4.dll C:\QtSDK\Desktop\Qt\4.7.4\msvc2008\plugins\sqldriv ers\qsqlmysqld4.dll Exported Function
    qt_plugin_query_verification_data 0x100011b8 0x000011b8 2 (0x2) qsqlmysqld4.dll C:\QtSDK\Desktop\Qt\4.7.4\msvc2008\plugins\sqldriv ers\qsqlmysqld4.dll Exported Function

    qsqlited4.dll exported function (using dll export viewer)
    qt_plugin_instance 0x10001410 0x00001410 1 (0x1) qsqlited4.dll C:\QtSDK\Desktop\Qt\4.7.4\msvc2008\plugins\sqldriv ers\qsqlited4.dll Exported Function
    qt_plugin_query_verification_data 0x100012cb 0x000012cb 2 (0x2) qsqlited4.dll C:\QtSDK\Desktop\Qt\4.7.4\msvc2008\plugins\sqldriv ers\qsqlited4.dll Exported Function

    It seems ok to me...

    I red similar threads in the forum but no solution unfortunatly .

    Has anybody solved this problem ?

    Stefano

  2. #2
    Join Date
    Sep 2011
    Posts
    20
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QMYSQL driver not loaded

    Hi,
    You require following file to make connectivity with Mysql db server.
    qsqlmysql4.dll
    libqsqlmysql4.a

    See below link to build mysql library.
    http://christopher.rasch-olsen.no/20...on-windows-xp/

Similar Threads

  1. QMYSQL driver not loaded
    By robotics in forum Qt Programming
    Replies: 3
    Last Post: 26th July 2011, 13:43
  2. Need Help:QSqlDatabase: QMYSQL driver not loaded
    By i4ba1 in forum Qt Programming
    Replies: 1
    Last Post: 9th January 2011, 19:39
  3. QMYSQL driver not loaded
    By cydside in forum Qt Programming
    Replies: 4
    Last Post: 31st March 2010, 03:18
  4. QMYSQL driver not loaded
    By akhila in forum Newbie
    Replies: 1
    Last Post: 22nd February 2010, 19:24
  5. QMYSQL driver not loaded
    By sepehr in forum Qt Programming
    Replies: 12
    Last Post: 11th January 2009, 21:15

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.