Results 1 to 5 of 5

Thread: QT 5.7 and MYSQL On Centos 7 - Driver Not Loaded

  1. #1
    Join Date
    Aug 2016
    Posts
    2
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default QT 5.7 and MYSQL On Centos 7 - Driver Not Loaded

    Getting the old....

    QSqlDatabase: QMYSQL driver not loaded
    QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QPSQL QPSQL7

    I think everything is installed correctly. Any help would be appreciated.

    Qt Code:
    1. #include <QCoreApplication>
    2. #include <QSqlDatabase>
    3. #include <QDebug>
    4. #include <iostream>
    5.  
    6. int main(int argc, char *argv[])
    7. {
    8. QCoreApplication a(argc, argv);
    9.  
    10. QSqlDatabase db(QSqlDatabase::addDatabase("QMYSQL3"));
    11.  
    12. //QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
    13. db.setHostName("127.0.0.1");
    14. db.setDatabaseName("QTTest");
    15. db.setUserName("root");
    16. db.setPassword("BOSS");
    17. bool ok = db.open();
    18.  
    19. qDebug() << ok;
    20.  
    21.  
    22. return a.exec();
    23. }
    To copy to clipboard, switch view to plain text mode 

    Thanks!

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QT 5.7 and MYSQL On Centos 7 - Driver Not Loaded

    Do you have the MySQL client library installed where the QMYSQL3 plugin can find it? On Windows, this will be named "libmysql.dll". It needs to be in the same directory as your executable (or in the PATH environment variable). On linux, it will probably be the same name, different extension. Still needs to be "findable" at runtime.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  3. #3
    Join Date
    Sep 2016
    Location
    Ukraine
    Posts
    1
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QT 5.7 and MYSQL On Centos 7 - Driver Not Loaded

    I have the same problem.
    Dose anybody solve it?

    Thanks.

  4. #4
    Join Date
    Jun 2014
    Posts
    47
    Thanks
    6
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QT 5.7 and MYSQL On Centos 7 - Driver Not Loaded

    perhaps this link will solve your problem
    http://www.qtcentre.org/threads/6890...ighlight=mysql

  5. #5
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QT 5.7 and MYSQL On Centos 7 - Driver Not Loaded

    @mersadwebseo: Reported for spamming.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. MYSQL driver not loaded.
    By sujan.dasmahapatra in forum Qt Programming
    Replies: 0
    Last Post: 30th November 2011, 18:13
  2. MySQL driver , I have, it still not loaded
    By bigkoma in forum Qt Programming
    Replies: 14
    Last Post: 30th January 2011, 10:38
  3. MySQL Driver not loaded on PC without Qt
    By KTvsPeacock in forum Installation and Deployment
    Replies: 39
    Last Post: 20th September 2010, 21:37
  4. Sql Driver: MYSQL not loaded
    By stilgar in forum Qt Programming
    Replies: 2
    Last Post: 15th June 2010, 10:35
  5. MySQL driver not loaded
    By hami in forum Installation and Deployment
    Replies: 1
    Last Post: 12th May 2009, 19:54

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.