Results 1 to 4 of 4

Thread: Release version of Application not connecting to MySql Database

  1. #1
    Join Date
    Feb 2009
    Posts
    21
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Release version of Application not connecting to MySql Database

    Hi there,

    I get the following error when I try to connect to a mysql database.

    QMYSQL driver not loaded

    for the release version of my application.

    I don't get this error for the debug version, which connects as expected.

    I am working on Windows XP with VS2008.

    I have built QT as follows -

    C:\Qt\2009.02\qt\src\plugins\sqldrivers\mysql>conf igure -no-qt3support -platform win32-msvc2008 -no-libtiff -no-phonon -no-phonon-backend -no-webkit -qt-sql-mysql -l libMySql -I C:\mysql\include -L C:\mysql\lib\opt -static -release

    C:\Qt\2009.02\qt\src\plugins\sqldrivers\mysql>nmak e sub-src

    And have directed the linker to link against -

    C:\Qt\2009.02\qt\lib\QtSqld4.lib

    for both release and debug.

    Any idea what the problem might be?

    Thanks,

    Barry

  2. #2
    Join Date
    Aug 2009
    Posts
    44
    Thanks
    29
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Release version of Application not connecting to MySql Database

    http://doc.qtsoftware.com/4.5/plugins-howto.html

    The fastest and easiest way is to create a directory called "sqldrivers" where the main executable is, and in that folder you have to put the right sql driver .dll

    See under your qt folder in the directory plugin (C:/../qt/plugins/sqldrivers/)

  3. #3
    Join Date
    Feb 2009
    Posts
    21
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Release version of Application not connecting to MySql Database

    Thanks very much for the reply!!!

    I copied the folder -

    C:\Qt\2009.02\qt\plugins\sqldrivers

    to my applications bin folder. Now I am informed that I have 1 available driver when I run the application - QSQLITE, whilst before I had none. However I still get the message -

    QSqlDatabase: QMYSQL driver not loaded

    What should I have in the sqldrivers folder with regards to mysql?

    I currently have -

    qsqlite4.dll
    qsqlite4.exp
    qsqlite4.lib
    qsqlite.lib
    qsqlited4.dll
    qsqlited4.exp
    qsqlited4.lib
    qsqlmysql.lib

    I'm guessing I need something like qsqlmysql.dll

    Any ideas?

    Thanks,

    Barry

  4. #4
    Join Date
    Sep 2010
    Location
    Poland
    Posts
    112
    Thanks
    8
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Maemo/MeeGo

    Default Re: Release version of Application not connecting to MySql Database

    first before first of all, I assume the problem exists on Windows platform, because installing appropriate packet on for example Debian is only typing qmysql (or something similar) in Synaptic

    than you're facing with the same problem as I do
    first of all, yes You need dll file as you posted

    this is explained here for example http://www.qtcentre.org/wiki/index.p...ws_using_MinGW

    secondly, depeding on your type of Qt installation (static or sharing libs) there are two ways two follow.
    By default Qt is installed with sharing, here is the description http://doc.qt.nokia.com/4.7/deployment-windows.html

    nevertheless I am convinced that not only qsqlmysql4.dll is required to be attached to executable file, but also libMySQL.dll which can be found in MySql installation folder.

    only after I'd added this dll my program reported than it has a valid mysql driver.
    using http://www.dependencywalker.com/ I noticed that qsqlmysql4.dll is loaded properly but application can not find libmySQL.dll file

    how this can be explained ? I mean, why qsqlmysql4.dll is not enough here ?
    My schedule makes my cry
    My works makes my laugh
    My life makes... oh...no....

Similar Threads

  1. Problem Wtih Connecting MySQL Database on Windows
    By dummystories in forum Installation and Deployment
    Replies: 25
    Last Post: 29th April 2009, 12:12
  2. Problem with application version and icon
    By cutie.monkey in forum Qt Programming
    Replies: 3
    Last Post: 18th December 2008, 02:22
  3. Qt designer plugin errors on OSX Leopard
    By mpotocnik in forum Qt Tools
    Replies: 10
    Last Post: 21st January 2008, 10:45
  4. Distributing QT application for Mac OS
    By mb0 in forum Qt Programming
    Replies: 1
    Last Post: 31st May 2007, 19:59
  5. Replies: 15
    Last Post: 21st April 2007, 18:46

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.