Results 1 to 6 of 6

Thread: qt4.3.1 mysql problem

  1. #1
    Join Date
    Apr 2007
    Posts
    10
    Qt products
    Qt4
    Platforms
    Windows

    Question qt 4.3.1 mysql plugin problem

    Hi,

    I have been using qt 4.2.2, mingw, and mysql 5.0 for some time with no problems. Recently I tried upgrading to qt 4.3.1 and now mysql is no longer functioning properly. I followed the steps below and everything seemed to go fine. No errors and I have the qsqlmysql4.dll and libqsqlmysql4.a files in my qt/4.3.1/plugins/sqldrivers directory as expected.

    My code builds without any errors but the problem is than now when I execute it, a message box pops up immediately saying:

    "The procedure entry point mysql_affected_rows@4 could not be located
    in the dynamic link library libmysql.dll"

    I've never seen this message before and I'm not sure what is causing it now. Nothing has changed as far as mysql is concerned. I've tried rebuilding (successfully) from scatch but the same thing happens everytime. I'm not sure what I am doing wrong and any help would be appreciated.

    thanx,

    tim



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

    Open a Qt Command Prompt and go to wherever you installed the MySQL server (C:\Program Files\MySQL\MySQL Server 5.0 is the default location).

    Goto the sub-directory lib/opt and run reimp libmysql.lib to produce the liblibmysql.a file. This is the import library to use with MinGW.

    Go to %QTDIR%/src/plugins/sqldrivers/mysql.
    Run the following command: qmake -o Makefile "INCLUDEPATH+=C:\Progra~1\MySQL\MySQLS~1.0\include " "LIBS+=C:\Progra~1\MySQL\MySQLS~1.0\lib\opt\liblib mysql.a"
    mysql.pro

    Run make - this should build the qsqlmysql.dll and libqsqlmysql.a files in the %QTDIR%/plugins/sqldrivers directory.

    Copy the libmysql.dll file from the MySQL installation's bin directory to a directory in %PATH% (e.g. %QTDIR%/bin).

    Now the plug-in should load properly. You may have to empty the plug-in cache before everything works though.

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

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: qt4.3.1 mysql problem

    Perhaps you have old version of Qt in PATH?
    J-P Nurmi

  3. #3
    Join Date
    Apr 2007
    Posts
    10
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: qt4.3.1 mysql problem

    JPN,

    Thanks for the reply. I checked the paths already and they all point to 4.3.1. Just to be sure I uninstalled 4.2.2 and removed all path references, but I still got the same error. Also, when I remove the mysql dll from 4.3.1, I get a can't find dll type error, so it seems to be looking in the right place. Others say they have got this working with 4.3.1 so it must be possible, but I'm running out of guesses....

    I'm wondering if there could be some registry keys left over from 4.2.2 giving me trouble, or if there is a switch I am forgetting to set to use the mysql plug-in with 4.3.1 which I had set with 4.2.2...it was a long time ago that I set that up.

    One other thing....the last line of the instructions I followed says:

    "You may have to empty the plug-in cache before everything works though."

    I don't know how to empty the plug-in cache....do you?

    tim

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: qt4.3.1 mysql problem

    Quote Originally Posted by twells55555 View Post
    One other thing....the last line of the instructions I followed says:

    "You may have to empty the plug-in cache before everything works though."

    I don't know how to empty the plug-in cache....do you?
    http://doc.trolltech.com/4.3/plugins...e-plugin-cache
    J-P Nurmi

  5. #5
    Join Date
    Apr 2007
    Posts
    10
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: qt4.3.1 mysql problem

    Yes, I've read that link on the plugin cache but I'm not sure exactly how to do it and I'm not very exerienced with the registry. Am I supposed to delete those keys in the registry so that QT can reinstall them?

    tim

  6. #6
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: qt4.3.1 mysql problem

    Yup, exactly. You can use regedit.exe to remove appropriate entries.
    J-P Nurmi

Similar Threads

  1. problem with plugin mysql
    By jose.va18 in forum Installation and Deployment
    Replies: 2
    Last Post: 19th September 2007, 12:12
  2. qt and mysql encoding problem
    By ferasodh in forum Qt Programming
    Replies: 1
    Last Post: 8th September 2007, 09:48
  3. MySQL starting problem
    By shamik in forum General Discussion
    Replies: 5
    Last Post: 25th April 2007, 07:20
  4. MySql Problem
    By vishesh in forum Installation and Deployment
    Replies: 7
    Last Post: 19th April 2007, 21:16

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.