J
J
Junior0072016-11-20 21:21:16
MySQL
Junior007, 2016-11-20 21:21:16

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

I would be very grateful even for a link to the instruction for noobs.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Rou1997, 2016-11-20
@Junior007

Climbing the plugin is not necessary if Qt is installed, but what is needed is to download the official library of the libmysql.dlldesired 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.

J
Jacob E, 2016-11-20
@Zifix

https://www.google.ru/search?q=mysql+build+driver+qt

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question