Hi, did you build Qt4 with MySQL support (by default it only supports SQLite database)?
To build Qt4 with MySQL support you need to run:
configure --plugin-sql-mysql
before make/nmake.
Enrico
Main Topics
Browse All TopicsHi !
I would like to know how to use the sql class with mysql. When i tried it, I got an error that says that the drivers are not load.
I have tried a lot of tutorials on the web but none of them works.
Can someone give me the steps to load or installs the mysql function !!
Thanks to everyone
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Hi,
I already tried this but I always got an error at the compilation... See
In file included from main.cpp:46:
../../../sql/drivers/mysql
y
In file included from main.cpp:46:
../../../sql/drivers/mysql
n
mingw32-make[4]: *** [tmp/obj/debug_shared/main
mingw32-make[4]: Leaving directory `C:/Qt/4.4.1/src/plugins/s
mingw32-make[3]: *** [debug-all] Error 2
mingw32-make[3]: Leaving directory `C:/Qt/4.4.1/src/plugins/s
mingw32-make[2]: *** [sub-mysql-make_default] Error 2
mingw32-make[2]: Leaving directory `C:/Qt/4.4.1/src/plugins/s
mingw32-make[1]: *** [sub-sqldrivers-make_defau
mingw32-make[1]: Leaving directory `C:/Qt/4.4.1/src/plugins'
mingw32-make: *** [sub-plugins-make_default-
By the way the command is "configure -plugin-sql-mysql"
Thanks for your help Enricod75
It's seems to work but now when i compile i get this error !
mingw32-make[4]: Entering directory `C:/Qt/4.4.1/src/plugins/i
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo
oc -Wl,-s -mthreads -Wl -shared -Wl,--out-implib,c:\Qt\4.4
s\libqjpeg4.a -o ..\..\..\..\plugins\imagef
.Release -L"c:\Qt\4.4.1\lib" -L"c:\Qt\4.4.1\lib" tmp\obj\release_shared\qjp
esource_res.o -lQtGui4 -lQtCore4
C:\MinGW\bin\..\lib\gcc\mi
n output file ..\..\..\..\plugins\imagef
collect2: ld returned 1 exit status
mingw32-make[4]: *** [..\..\..\..\plugins\image
mingw32-make[4]: Leaving directory `C:/Qt/4.4.1/src/plugins/i
mingw32-make[3]: *** [release-all] Error 2
mingw32-make[3]: Leaving directory `C:/Qt/4.4.1/src/plugins/i
mingw32-make[2]: *** [sub-jpeg-make_default] Error 2
mingw32-make[2]: Leaving directory `C:/Qt/4.4.1/src/plugins/i
mingw32-make[1]: *** [sub-imageformats-make_def
mingw32-make[1]: Leaving directory `C:/Qt/4.4.1/src/plugins'
mingw32-make: *** [sub-plugins-make_default-
It seems that you can't access this directory:
C:\Qt\4.4.1\plugins\imagef
It is strange, becuause in my installation of Qt the directory is present.
Please ensure that the directory exists and that you have write access to it
A suggestion: if you run into problems using MingW as a compiler, you might consider switching to the free Visual C++ Express 2008, which is a fairly good compiler.
I used Visual Studio (not the express version) to compile Qt 4.4 open source, and never ran into problems.
I know for sure that Visual C++ Express also works correctly with Qt.
For more information please look at this link:
http://da-crystal.net/GCMS
Business Accounts
Answer for Membership
by: tinzakerPosted on 2008-09-07 at 12:40:32ID: 22412516
Up !