[Qt-interest] QMYSQL driver

Shaun van Wyngaard shaunv at pdc.co.za
Thu Nov 19 12:07:55 CET 2009


I have been trying for a long time to get my QMYSQL driver working. It works
on my developer machine, but not on my computer where I want to load it.

Before I get told that "Google is my friend" or similar, can I say that I
have been searching MANY postings on this same problem, but still I am not
able to get it working!

If anything, I came across many different approaches to this problem.

 

I followed these instructions: (kindly given via this same mailing list)

 

******************************************************************

First you need download the c connector for mysql, the recent is
"mysql-connector-c-6.0.2-win32", install it and observe the destination
folder.

After install i:
a) copy the header folder from the destination of the instalation to
c:\qt\qtsdk-2009.04\qt\src\plugins\sqldrivers\mysql.
b) copy libmysql.lib from the destination of the instalation to
c:\qt\qtsdk-2009.04\qt\src\plugins\sqldrivers\mysql.

Open a qt command prompt and:
a) qmake "INCLUDEPATH+=.\\" "LIBS+=.\\libmysql.lib" mysql.pro
b) nmake or mingw32-make (mingw32-make is installed with open source of qt)
c) nmake install or mingw32-make install (this copy the dll to the
c:\qt\qtsdk-2009.04\qt\plugins\sqldrivers
d)You get qsqlmysql4.dll

For the release:
a) qmake "INCLUDEPATH+=.\\" "LIBS+=.\\libmysql.lib" mysql.pro
b) nmake or mingw32-make release (mingw32-make is installed with open source
of qt)
c) nmake install or mingw32-make install (this copy the dll to the
c:\qt\qtsdk-2009.04\qt\plugins\sqldrivers
d)You get qsqlmysql4d.dll

d) REMEMBER, if your proyect is builded in debug mode the mysql dll must be
build in debug mode, if your proyect is builded in release mode the mysql
dll must be in release mode.
******************************************************************

 And with some work, managed to get the debug dll working, but not the
release version.

My question here is why I had issues like unable to find header files from
main.cpp, mysql.pro etc when running the mingw32-make . I had to manually
edit these files with a direct link to the filels it looked for, it didn't
just find them, initially it would have

#include "../../src." etc, I had to type in the EXACT path to look for it
in. Is it because my path wasn't set up correctly? I did a stock standard
install of SDK 2009.04, then did a Qt Creator upgrade to the latest version,
again standard install.

 

I want to first get everything set up properly before moving onto the plugin
of the QMYSQL driver not working, so if someone can help me with this first,
I would appreciate it.

 

Shaun

 


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091119/cbe79f79/attachment.html 


More information about the Qt-interest-old mailing list