QT 5.5, windows 7, and MySQL
I have done QT 5.5 and MySQL connection.
Running official QT example SQL Browser works fine.
I share my experience here. 
(1) MySQL's sql driver can be found under QT directory
File names are: qsqlmysql.dll及 qsqlmysqld.dll
(We do not need to compile SQL driver) 
(2) We need to add SQL library support in *.pro file as below.
QT += sql


(3) The point is under Windows 7 (Win7), we need to put libmysql.dll to the folder of *.exe file. Here is my example. The *.exe file is sqlbrowser.exe.
2016-03-14 09_00_41-debug.png
How can we get libmysql.dll?
Please go to MySQL website, and download "Windows (x86, 32-bit), ZIP Archive".
Unzip the zip file and you can get it in mysql-5.7.11-win32\lib\libmysql.dll
Copy libmysql.dll file to the same folder with *.exe.
Let me summary my article. You just need to do the step (3). (The part in blue)
創作者 mybeauty 的頭像


mybeauty 發表在 痞客邦 留言(0) 人氣()