Results 1 to 4 of 4

Thread: QMYSQL Driver not Loaded, there are no driver Available on the QSqlDatabase

  1. #1
    Join Date
    May 2019
    Posts
    6
    Thanks
    1
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default QMYSQL Driver not Loaded, there are no driver Available on the QSqlDatabase

    Hello,

    I am currently developing a app that requires interaction with a MySQL database. I already installed MySQL and the x32 C++ Connector. Tried copying its libraries into the project folder, copied the sqldrivers folder from Qt plugins, installed the x64 C++ Connector and copied the libraries again.
    Still, I receive the one error to rule them all:

    "QSqlDatabase: QMYSQL driver not loaded
    QSqlDatabase: available drivers: -------> strange "empty"

    Do you have any insight as to why this happens?
    I am programming on Windows 10 x64.

    Thanks in advance!

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,325
    Thanks
    36
    Thanked 1,527 Times in 1,478 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QMYSQL Driver not Loaded, there are no driver Available on the QSqlDatabase

    Maybe the plugin itself can't be found.

    To debug further set the QT_DEBUG_PLUGINS environment variable to 1, this should give you some output on what the Qt plugin loader does.
    See https://doc.qt.io/qt-5/deployment-pl...ugging-plugins

    Or try a different SQL plugin, e.g. for SQLite, just to see if that can be loaded and only the one for MySQL cannot.

    Cheers,
    _

  3. The following user says thank you to anda_skoa for this useful post:

    aymenbest2 (27th May 2019)

  4. #3
    Join Date
    May 2019
    Posts
    6
    Thanks
    1
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: QMYSQL Driver not Loaded, there are no driver Available on the QSqlDatabase

    Thank you very much, i tried with
    int main(int argc, char *argv[])
    {
    QT_REQUIRE_VERSION(argc,argv,QT_VERSION_STR);
    qputenv("QT_DEBUG_PLUGINS", QByteArray("1"));
    //QApplication a(argc, argv);
    MyApplication a(argc, argv);
    ....
    }
    but nothing has changed in the log file? i set QT_DEBUG_PLUGINS = 1 in the Build Environement as well, i had always no changes.
    i reconfigured my qt with -plugin-sql-sql, though i know that s not needed. saddly i have always the some Problem. so I reinstall QT 4.8.6 with the default configuration.
    Cheers,

  5. #4
    Join Date
    May 2019
    Posts
    6
    Thanks
    1
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: QMYSQL Driver not Loaded, there are no driver Available on the QSqlDatabase

    hello,
    Solved by setting QT_PLUGIN_PATH=`pwd`/plugins in the Build environement
    cheers,

Similar Threads

  1. QSqlDatabase: QMYSQL driver not loaded with certain OS
    By salamander in forum Installation and Deployment
    Replies: 2
    Last Post: 7th June 2019, 16:13
  2. QSqlDatabase: QMYSQL driver not loaded
    By BuranereLoo in forum Newbie
    Replies: 4
    Last Post: 25th August 2015, 16:34
  3. QSqlDatabase: QMYSQL driver not loaded
    By edsonmcz in forum Qt Programming
    Replies: 7
    Last Post: 15th November 2014, 07:29
  4. QSqlDatabase: QMYSQL driver not loaded
    By prachik in forum Newbie
    Replies: 1
    Last Post: 13th January 2014, 20:40
  5. QSqlDatabase: QMYSQL driver not loaded
    By lise in forum Newbie
    Replies: 3
    Last Post: 1st June 2010, 13:09

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.