Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Why is my qt5.5 driver not loaded?


Asked by Kody Leon on Dec 10, 2021 FAQ



In Short: I am trying to link my Qt5.5 to MySQL but it is not working. The long story begins when I tried to use MySQL as in: QSqlDatabase theDatabase = QSqlDatabase::addDatabase("QMYSQL"... Stack Overflow About Products For Teams Stack OverflowPublic questions & answers
In this manner,
Drivers can be built separately, though. If the Qt build is configured with -prefix, it is necessary to install the plugins after building them, too. For example: MariaDB is a fork of MySQL intended to remain free and open-source software under the GNU General Public License.
Similarly, Qt comes with it's own version of sqlite and IIRC when building your own version you have to tell configure to use the system's available sqlite if you don't want to use Qt's version. Because you didn't install all related dev packages so to the auto detection failed for the other drivers and thus you only have the sqlite plugin.
Furthermore,
Typical symptom when trying to connect to MySQL / MariaDB using Qt but without the necessary plugin is the runtime error Since the Qt Company currently doesn't give a crap on providing qsqlmysql.dll / libqsqlmysql.so in binary form, you have to build it on your own, which can be a pain.
Thereof,
Since the Qt Company currently doesn't give a crap on providing qsqlmysql.dll / libqsqlmysql.so in binary form, you have to build it on your own, which can be a pain. Here is a build for various Qt versions. Get precompiled qsqlmysql.dll for Windows / libqsqlmysql.so for Linux from releases