Qt - QMYSQL driver not loaded
The problem occurs when attempting to run a program that uses a MySQL database.
Solution
$ cd ~/Qt5.12.12/5.12.12/Src/qtbase/src/plugins/sqldrivers/mysql
$ ~/Qt5.12.12/5.12.12/gcc_64/bin/qmake
$ make
$ make install
Replace 5.12.12
with the version you have. The libraries will appear in ~/Qt5.12.12/5.12.12/Src/qtbase/src/plugins/sqldrivers/plugins/sqldrivers
.
At the end, copy the sqldrivers directory to the location where the binary is located (or copy the individual library).
Possible issues
Qt Sql Drivers:
DB2 (IBM) .............................. no
InterBase .............................. no
MySql .................................. no
OCI (Oracle) ........................... no
ODBC ................................... no
PostgreSQL ............................. no
SQLite2 ................................ no
SQLite ................................. no
Using system provided SQLite ......... no
TDS (Sybase) ........................... no
To handle this:
- Install
libmysqlclient-dev
,mysql-client
, andlibssl-dev
(optionally, alsolibqt5sql5-mysql
). - Delete the
config.cache
file. - Repeat the procedure from Solution.