tags:

views:

411

answers:

2

I've installed recent Qt (4.5.3) sdk windows version. I'm want to use mysql in my app. Since Qt Mysql plugin in not available, so I compiled it from the included source. I copied compiled files D:\\Qt\2009.01\qt\plugins\sqldrivers.

Now when I run my application it still error "QMYSQL driver not loaded".

A: 

I suggest you take the whole Qt4 source code and compile it specifically for your own needs.

Something like this should do the job just fine:

  1. Download the Qt source code from qt.nokia.com
  2. Extract it somehwere and open a command prompt.
  3. "cd" into the source directory and run "configure":

Just an example:

/Devel/qt/configure
    -release
    -fast
    -opensource
    -nomake "demos examples"
    -silent
    -qt-sql-mysql

You might have to additionally provide -I C:\path\to\mysql\includes and -L C:\path\to\mysql\libs.

After that, do "make install".

Hope that helps.

BastiBense
this seems the only solution.
Sharique
A: 

Hi Sharique,

There may be several reasons leading to the driver not being loaded, I experienced several of them in my Qt experience. Qt provides good documentation on this point, I suggest you have a look at the Troubleshooting subsection of Qt Assistant's SQL Database drivers section, it should help you diagnose your problem. It worked for me.

Hope that helps.

Freddy