Answer the question
In order to leave comments, you need to log in
How to connect MySQL to QT?
How to connect MySQL to QT?
Searched, searched, did not find. Somewhere they write that you need to somehow build the plugin yourself, but how to do it?
Here's what it outputs:
QSqlDatabase: QMYSQL driver not loaded
QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7
Answer the question
In order to leave comments, you need to log in
Climbing the plugin is not necessary if Qt is installed, but what is needed is to download the official library of the libmysql.dll
desired architecture (x86 or x64) and put it in the same folder as the EXE.
As for the plugin, in order to work without Qt installed, you need to put the sqldrivers folder with the qsqlmysql.dll file in the EXE folder, this is the plugin (wrapper for libmysql.dll
), you will find this folder and this file where Qt is installed, but once again you need to put the plugin only for distribution, and you have Qt installed entirely, so it should work without it.
In general, Qt has quite a few problems like thislibmysql.dll
, so develop analytical thinking, in this case it was worth trying other types of databases and coming to the conclusion that the problem is with MySQL, and also learn to debug and use the source code, it is open for Qt.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question