Results 1 to 12 of 12

Thread: MySql plugin driver issues

  1. #1
    Join Date
    Mar 2006
    Posts
    140
    Thanks
    8
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default MySql plugin driver issues

    Hi,

    I've been having some issues with MySql and Qt 4.
    I managed to get the plugin compiled without any hassles under 4.1.4 on my home machine.
    That machine does have MySql 5 running as a system service.
    I wrote a test app which calls QSqlDatabase::drivers() so I can confirm the successful detection of the compiled plugin.
    QMYSQL appears in my list, yay!

    On another PC I use at work, I successfully built the plugin using the exact same steps and no errors occurred.
    But, when I run the test app the driver won't appear.

    I've tried doing it manually as described in the Qt documentation, as well as a complete Qt rebuild passing -plugin-sql-mysql and -qt-sql-mysql as an argument, yet it makes no difference. (By the way, I did mod the .pro file giving the location of the headers and lib before running configure.exe).

    Next, I tried simply copying my entire Qt folder from home to work, then ran the test app.
    I had compiled ODBC as well on the home build.
    These ODBC drivers came up at work, but the QMYSQL driver didn't appear.

    Why, given an identical Qt build would the QMYSQL driver not be detected?
    I'm not running MySql at work but I can't see why that would matter.
    I've also tried this with 4.2 snapshots but get the same issue.

    Any ideas?


    Steve

  2. #2
    Join Date
    Mar 2006
    Posts
    58
    Thanks
    2
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: MySql plugin driver issues

    ".......
    I'm not running MySql at work but I can't see why that would matter......"

    How did you build the mysql plugin without mysql on the machine?

  3. #3
    Join Date
    Mar 2006
    Posts
    140
    Thanks
    8
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: MySql plugin driver issues

    I had the no-install version extracted to C:
    then I was able to reference the headers and libs.

    What I mean is it's not running on the machine.

  4. #4
    Join Date
    Mar 2006
    Posts
    58
    Thanks
    2
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: MySql plugin driver issues

    Quote Originally Posted by stevey View Post
    I had the no-install version extracted to C:
    then I was able to reference the headers and libs.

    What I mean is it's not running on the machine.
    Ah, I see I misunderstood you.

    "(By the way, I did mod the .pro file giving the location of the headers and lib before running configure.exe)"
    Can you explain me what you did here? Sometimes I have problems with MySQL also.

  5. #5
    Join Date
    Mar 2006
    Posts
    140
    Thanks
    8
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: MySql plugin driver issues

    Hi,

    I opened C:\Qt\4.2.0-snapshot-20060801\src\plugins\sqldrivers\mysql\mysql.pro
    and added these lines:
    Qt Code:
    1. INCLUDEPATH += c:\MySQL\include
    2. LIBS += c:\MySQL\lib\opt\libmysql.lib
    To copy to clipboard, switch view to plain text mode 

    Then I ran configure.exe and nmake.

    The way I understand it is that the plugin system scans the plugins\sqldrivers for all dynamic libraries matching the sql plugin interface (and build number).
    Given that my qsqlmysql dll files are feshly built into the correct place, why wouldn't Qt know about them?
    Especially, the fact that I copied a build directory where it worked on another machine, I can't see why it wouldn't work here given it's the same enviroment.


    Thanks for the reply,

    Steve York
    Last edited by stevey; 18th September 2006 at 05:39.

  6. #6
    Join Date
    Mar 2006
    Posts
    58
    Thanks
    2
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: MySql plugin driver issues

    Sorry, I could not actually help you, but I was curious as to what your problem was, etc...

    I am going to try rebuild Qt using your above mentioned method to build the plugin. Did you build -static or -shared? And what was the all configures for configure...?

  7. #7
    Join Date
    Mar 2006
    Posts
    140
    Thanks
    8
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: MySql plugin driver issues

    On both machines, I simply did 'configure.exe -plugin-sql-mysql' (Well on the home one I had ODBC going as well) so I let it do the defaults for everything else.

  8. #8
    Join Date
    Mar 2006
    Posts
    58
    Thanks
    2
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: MySql plugin driver issues

    Out of curious, how many header files have you in your include directory for mysql?

  9. #9
    Join Date
    Mar 2006
    Posts
    140
    Thanks
    8
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: MySql plugin driver issues

    There are 23 files in c:\MySQL\include
    The version I'm building against is 5.0.24a-win32

  10. #10
    Join Date
    Mar 2006
    Posts
    58
    Thanks
    2
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: MySql plugin driver issues

    ok..identical here....22 headers and one .def

  11. #11
    Join Date
    Mar 2006
    Posts
    140
    Thanks
    8
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: MySql plugin driver issues

    Right,

    I've recompiled Qt with QT_DEBUG_COMPONENT defined.
    When I run my test app, I get the following comments when Qt scans the mysql dll files
    Qt Code:
    1. QFactoryLoader::QFactoryLoader() looking at "C:/Qt/4.2.0-snapshot-20060801/plugins/sqldrivers/qsqlmysql.dll"
    2. not a plugin
    To copy to clipboard, switch view to plain text mode 
    Can anyone explain how this could possibly NOT be a plugin?
    Especially given that it worked fine as a plugin on one machine, then when copied to another machine (without recompiling) it doesn't appear as a plugin?

    What this implies to me is that the library doesn't implement an sql plugin, but it does.
    So I just can't understand how this is supposed to work.


    Thanks,

    Steve York

  12. #12
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 975 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: MySql plugin driver issues

    Quote Originally Posted by stevey View Post
    Especially given that it worked fine as a plugin on one machine, then when copied to another machine (without recompiling) it doesn't appear as a plugin?
    Do you use the same compiler on both machines?

Similar Threads

  1. MySQL plugin
    By ksqt in forum Installation and Deployment
    Replies: 12
    Last Post: 24th September 2009, 14:26
  2. Issues regarding QMySql drivers and mysql database
    By bera82 in forum Qt Programming
    Replies: 2
    Last Post: 10th August 2006, 18:50
  3. Problems building mysql plugin for Qt 4.1.2 on windows XP
    By Philip_Anselmo in forum Installation and Deployment
    Replies: 3
    Last Post: 17th May 2006, 16:38
  4. mySql Result Datatype issues!!!
    By bera82 in forum Qt Programming
    Replies: 2
    Last Post: 21st March 2006, 11:26
  5. Building of MySQL plugin fails
    By janca in forum Installation and Deployment
    Replies: 2
    Last Post: 21st January 2006, 09:23

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.