Results 1 to 3 of 3

Thread: Qt5.2 can find the mysql driver but can not load it

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2011
    Posts
    127
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    42
    Thanked 4 Times in 4 Posts

    Default Qt5.2 can find the mysql driver but can not load it

    os : win7
    compiler : mingw4.8(come with Qt5.2)
    link to : Fedora core release 5, kernel 2.6.15-1.2054_FC5 smp on an i686

    Qt Code:
    1. db = new QSqlDatabase();
    2. db->addDatabase("QMYSQL");
    3. db->setHostName("localhost");
    4. db->setDatabaseName("myclinic");
    5. db->setUserName("root");
    6. db->setPassword(",trth12");
    7.  
    8. qDebug() << loader.errorString();
    9. qDebug() << "drivers: "<< QSqlDatabase::drivers();
    10.  
    11. if (db->open())
    12. qDebug() << "Success!";
    13. else
    14. qDebug() << db->lastError().text();
    To copy to clipboard, switch view to plain text mode 


    messages

    QSqlDatabase: QMYSQL driver not loaded QSqlDatabase: available
    drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL 7 “The shared
    library was not found.” drivers: (“QSQLITE”, “QMYSQL”, “QMYSQL3”,
    “QODBC”, “QODBC3”, “QPSQL”, “QPSQL7”)

    “Driver not loaded Driver not loaded”

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Wiki edits
    17

    Default Re: Qt5.2 can find the mysql driver but can not load it

    The MySQL runtime library is likely to be absent from your Windows system or not available on the standard PATH. The Qt Mysql driver is dependent on it.

  3. #3
    Join Date
    Jan 2011
    Posts
    127
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    42
    Thanked 4 Times in 4 Posts

    Default Re: Qt5.2 can find the mysql driver but can not load it

    Thanks, I solved the problem.looks like win7 do not come with the dll

Similar Threads

  1. How to load Mysql driver?
    By adutzu89 in forum Newbie
    Replies: 7
    Last Post: 21st December 2013, 04:14
  2. Qt Creator App launched by run option does not load mysql driver
    By l0ud in forum Qt Tools
    Replies: 0
    Last Post: 19th September 2012, 18:48
  3. cannot load mysql driver
    By saman_artorious in forum Qt Programming
    Replies: 1
    Last Post: 9th July 2012, 01:08
  4. source code for odbc driver or MySql driver in arm-embedded-linux
    By sattu in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 24th January 2011, 10:11
  5. I need MySQL driver for Qt 4.6, WindowsXP(32), MySQL 5.1
    By User_3 in forum Installation and Deployment
    Replies: 7
    Last Post: 15th October 2010, 15:19

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
  •  
Qt is a trademark of The Qt Company.