Qsqldatabase: Qmysql Driver Not Loaded on Ubuntu 15.04 64Bits

QSqlDatabase: QMYSQL driver not loaded on Ubuntu 15.04 64bits

First and foremost, double check that you have the packages containing libssl.so, libcrypto.so and libmysqlclient_r.so installed (looks like you have this last one, it's extremely likely you also have the first two, but just double check).

Then, your problem is that you have those shared objects with a different SONAME, sign that they're binary incompatible with the plugin shipped with Qt, which therefore needs to be recompiled.

Therefore:

  1. install the development versions of the packages found above (libssl-dev, mysql-client-dev or similar).

  2. run the MaintenanceTool from your Qt installation, and be sure to select to install Qt's source code too.

  3. Go in QTDIR/5.6/Src/qtbase/src/plugins/sqldrivers/mysql/.

  4. Run the right qmake, i.e. the one coming from that installation of Qt (not the system wide one or similar). Best way to be sure is providing the full path to it: QTDIR/5.6/gcc_64/bin/qmake.

  5. Run make. Hopefully this will just work™; if it complains about some missing libraries, install them and rerun make.

  6. This should now have produced a new libqsqlmysql.so plugin; overwrite the old one with this new one.

QMYSQL driver available but not loaded

ok it worked just by copying the sqldrivers folder to my debug folder and it worked!

QMYSQL available but not load

I have reopened the question why the steps in the @peppe answer need to be updated for recent versions of Qt.

Steps:

  1. Install the development versions of the packages found above: libmysqlclient-dev

  2. Run the MaintenanceTool from your Qt installation, and be sure to select to install Qt's source code too, or clone the project using:

    git clone -b YOUR_QT_VERSION https://github.com/qt/qtbase.git

    or

    git clone -b YOUR_QT_VERSION git://code.qt.io/qt/qtbase.git

    in this case YOUR_QT_VERSION=5.13.2)

  3. Go in QTDIR/QT_VERSION/Src/qtbase/src/plugins/sqldrivers/

  4. Run the right qmake, i.e. the one coming from that installation of Qt (not the system wide one or similar). Best way to be sure is providing the full path to it: QTDIR/QT_VERSION/gcc_64/bin/qmake sqldrivers.pro

  5. Run make && make install

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

Thanks for the answer, but the problem is not because I lack the qsqlmysql.dll but I don't have the libmysql.dll(looks like this dll do not come with win7).

Here is a video which show you how to install mysql

[Qt][QMYSQL] Deployed app - Driver not loaded

There are at least 3 possible solutions:

  1. Find all .dll paths are correct with your favourite process monitor
  2. Make sure all .dll is in the same arch as your .exe, which is x86 (32bit)
  3. Debug with QPluginLoader

Cannot load SQL driver in Visual C++ (but loads in QtCreator)

For anyone else who bumped into this problem I have to say this - it is much easier to use one of the packages containing QT pre-built binaries for Visual C++ than trying to build it yourself. And the Qt driver (the 4.3 version at least) is awfully hard to get to work (on some machines it works like a charm but on others it can't find the driver, using the same code and binaries), so you are much better off using a dedicated MySql library.



Related Topics



Leave a reply



Submit