Results 1 to 15 of 15

Thread: MySQL driver , I have, it still not loaded

  1. #1
    Join Date
    Feb 2009
    Location
    Bydgoszcz, Poland
    Posts
    16
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default MySQL driver , I have, it still not loaded

    Hi,

    I make MySQL driver , I have in :

    Qt Code:
    1. C:\Qt\2009.02\bin\sqldrivers
    2.  
    3. 2009-04-01 15:53 2*359*296 libmysql.dll
    4. 2009-04-22 10:58 2*168 libqsqlite4.a
    5. 2009-04-22 10:58 2*178 libqsqlited4.a
    6. 2009-04-30 18:01 2*182 libqsqlmysql4.a
    7. 2009-04-30 18:00 2*192 libqsqlmysqld4.a
    8. 2009-04-22 10:57 2*178 libqsqlodbc4.a
    9. 2009-04-22 10:57 2*182 libqsqlodbcd4.a
    10. 2009-04-15 14:16 347*648 qsqlite4.dll
    11. 2009-04-29 18:42 2*793*327 qsqlited4.dll
    12. 2009-04-30 18:01 81*920 qsqlmysql4.dll
    13. 2009-04-30 18:00 1*587*413 qsqlmysqld4.dll
    14. 2009-04-22 10:57 152*576 qsqlodbc4.dll
    15. 2009-04-22 10:57 1*593*196 qsqlodbcd4.dll
    To copy to clipboard, switch view to plain text mode 

    But driver still can't load :
    Qt Code:
    1. QSqlDatabase: QMYSQLDriver driver not loaded
    2. QSqlDatabase: available drivers: QSQLITE QODBC3 QODBC
    To copy to clipboard, switch view to plain text mode 

    I use QTCreator.

    ---- Edit ----

    configure -qt-sql-mysql :

    Qt Code:
    1. ...
    2. Sql Drivers:
    3. ODBC....................no
    4. MySQL...................yes
    5. OCI.....................no
    6. PostgreSQL..............no
    7. TDS.....................no
    8. DB2.....................no
    9. SQLite..................plugin (qt)
    10. SQLite2.................no
    11. InterBase...............no
    12. ...
    To copy to clipboard, switch view to plain text mode 
    Last edited by bigkoma; 30th April 2009 at 18:49.

  2. #2
    Join Date
    Jan 2006
    Location
    Ljubljana
    Posts
    687
    Thanks
    111
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: MySQL driver , I have, it still not loaded

    Try to copy mysql files to %QTDIR%\bin directory, it worked for me...
    Qt 5.3 Opensource & Creator 3.1.2

  3. #3
    Join Date
    Feb 2009
    Location
    Bydgoszcz, Poland
    Posts
    16
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: MySQL driver , I have, it still not loaded

    Quote Originally Posted by MarkoSan View Post
    Try to copy mysql files to %QTDIR%\bin directory, it worked for me...
    :/ no, it dosn't work . I still have error :

    Qt Code:
    1. QSqlDatabase: QMYSQL driver not loaded
    2. QSqlDatabase: available drivers: QSQLITE QODBC3 QODBC
    To copy to clipboard, switch view to plain text mode 

  4. #4
    Join Date
    Aug 2006
    Location
    Some where in Argentina
    Posts
    23
    Thanks
    4
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: MySQL driver , I have, it still not loaded

    make shure that you have the libs and headers from mysql.com whithin the same directory that the aplication is executed

  5. #5
    Join Date
    Feb 2009
    Location
    Bydgoszcz, Poland
    Posts
    16
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Smile Re: MySQL driver , I have, it still not loaded

    Hi , I recompile all QT library in QTCreator, but before I :

    1. Copied files from :
    Qt Code:
    1. C:\Program Files\MySQL\MySQL Server 5.1\include
    To copy to clipboard, switch view to plain text mode 
    and
    Qt Code:
    1. C:\Program Files\MySQL\MySQL Server 5.1\lib\opt
    To copy to clipboard, switch view to plain text mode 
    to
    Qt Code:
    1. C:\Qt\4.5.1\src\plugins\sqldrivers\mysql
    To copy to clipboard, switch view to plain text mode 

    2. I edit:
    Qt Code:
    1. C:\Qt\4.5.1\src\plugins\sqldrivers\mysql\mysql.pro
    To copy to clipboard, switch view to plain text mode 
    and in line were is :
    LIBS *= -llibmysql
    change to
    LIBS *= -libmysql

    3. You must check that you have a files :
    Qt Code:
    1. libmysql.a
    2. libmysql.dll
    3. libmysql.def
    To copy to clipboard, switch view to plain text mode 
    because in many tutorials is create different file name like : liblibmysql

    4. In QTDir run :
    Qt Code:
    1. configure -qt-sql-mysql
    To copy to clipboard, switch view to plain text mode 

    5. I opened in QTCreator file:
    Qt Code:
    1. C:\Qt\4.5.1\projects.pro
    To copy to clipboard, switch view to plain text mode 
    and I click compile.

    You didn't must wait to end ,because you only need wait to a moment when all sql driver is end compiled. For safe you wait to end

    I hope that you understand me
    Last edited by bigkoma; 8th May 2009 at 00:38.

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,013 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: MySQL driver , I have, it still not loaded

    Do you have Qt compiled in debug or release mode?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    May 2009
    Posts
    28
    Thanks
    1
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: MySQL driver , I have, it still not loaded

    i have the same problem with QIBASE !
    but QMYSQL work fine with me
    it's easy to make it working but under linux and i see you are using windows !

    good luck .

  8. #8
    Join Date
    Feb 2009
    Location
    Bydgoszcz, Poland
    Posts
    16
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: MySQL driver , I have, it still not loaded

    For me my method is working.


    P.S. I programing in Linux, becouse ther I no have any problem's. But now I have a project who must work in Windows as client.

  9. #9
    Join Date
    May 2009
    Location
    Poland
    Posts
    5
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: MySQL driver , I have, it still not loaded

    Quote Originally Posted by QAmazigh View Post
    i have the same problem with QIBASE !
    Me too. Have you solved the problem?

  10. #10
    Join Date
    May 2009
    Location
    Poland
    Posts
    5
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Question Re: MySQL driver , I have, it still not loaded; Firebird response

    I've found then answer and I would share with other people that aren't able to make qt app load ibase drive. I hope I can help them.

    1. At the beginning of the main.cpp (after creating QApplication instance) put the code line:
    Qt Code:
    1. qApp->addLibraryPath(qApp->applicationDirPath() + "/plugins");
    To copy to clipboard, switch view to plain text mode 
    Then follows creating connection like this
    Qt Code:
    1. QSqlDatabase db = QSqlDatabase::addDatabase("QIBASE");
    2. db.setHostName("localhost");
    3. db.setDatabaseName(dbpath);
    4. db.setUserName("SYSDBA");
    5. db.setPassword("masterkey");
    6. bool ok=db.open();
    To copy to clipboard, switch view to plain text mode 
    2. Create "plugins" folder and "sqldrivers" in the first one and put there the driver: qsqlibased4.dll
    3. Put fbclient.dll to your app directory

    Then final directory tree looks like this (for the debug build):
    C:\Project\debug\project.exe
    C:\Project\debug\fbclient.dll
    C:\Project\debug\plugins\sqldrivers\qsqlibased4.dll

    I have a question: what difference is between qsqlibase4.dll and qsqlibased4.dll?

  11. #11
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,013 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: MySQL driver , I have, it still not loaded; Firebird response

    Quote Originally Posted by lucenty View Post
    I have a question: what difference is between qsqlibase4.dll and qsqlibased4.dll?
    The latter is a debug version of the plugin. It's required on Windows if your application is built in debug mode.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  12. The following 2 users say thank you to wysota for this useful post:

    lucenty (10th August 2009), Raccoon29 (16th December 2009)

  13. #12
    Join Date
    Feb 2009
    Location
    Bydgoszcz, Poland
    Posts
    16
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: MySQL driver , I have, it still not loaded; Firebird response

    I have new problem

    I have installed the newest QT version (2010.5). I compiled MySql (http://blog.rubypdf.com/2010/08/11/h...s-using-mingw/). I opened QtCreator , compiled my aplication and it worked, so I can be happy .... but I'm no happy beacourse this aplication don't work in another system ..... "Driver not loaded"
    (I had copied all library)

    Interesing is that this aplication not work ( the same error) when I change the Folder ("sqldriver") name in lokation : "C:\qt\2010.05\qt\plugins\".
    So I thought that I must copy all file from this directory to my aplikation directory , then it should work ... but not.

    Were is the problem ??

  14. #13
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: MySQL driver , I have, it still not loaded; Firebird response

    Quote Originally Posted by bigkoma View Post
    but I'm no happy beacourse this aplication don't work in another system ..... "Driver not loaded"
    (I had copied all library)
    Obviously you havn't or at the wrong place. So where have you copied them? Or have a look at qt.conf to define the place your application should look for the plugins.

  15. The following user says thank you to Lykurg for this useful post:

    bigkoma (30th January 2011)

  16. #14
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,013 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: MySQL driver , I have, it still not loaded; Firebird response

    Do you have MySQL client library (not the Qt plugin) installed on the other system?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  17. #15
    Join Date
    Feb 2009
    Location
    Bydgoszcz, Poland
    Posts
    16
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: MySQL driver , I have, it still not loaded; Firebird response

    Quote Originally Posted by Lykurg View Post
    Or have a look at qt.conf to define the place your application should look for the plugins.
    Where do I have to look for this?


    =====================================
    edit
    =====================================

    Lykurg - thanks for information,

    My "qt.conf" (in my application location) have simple look:

    Qt Code:
    1. [Paths]
    2. Plugins = ./plugins
    To copy to clipboard, switch view to plain text mode 

    So in location where I have my application, I created new folder "plugins" and copied the folder "sqldriver" from QT location to this folder.
    Last edited by bigkoma; 30th January 2011 at 12:45.

Similar Threads

  1. Unhandled exception in qatomic
    By NewGuy in forum Qt Programming
    Replies: 14
    Last Post: 23rd July 2013, 10:49
  2. mysql driver not loaded after deployment
    By tpf80 in forum Newbie
    Replies: 4
    Last Post: 4th September 2011, 11:12
  3. exception at 0x65100c40 (QtGuid4.dll)
    By sabeesh in forum Qt Programming
    Replies: 11
    Last Post: 21st December 2007, 18:10
  4. My Mysql 5 and Qt 4.2.2 Problem (Driver not loaded)
    By fengtian.we in forum Qt Programming
    Replies: 4
    Last Post: 9th February 2007, 09:11
  5. MySql plugin driver issues
    By stevey in forum Installation and Deployment
    Replies: 11
    Last Post: 20th September 2006, 14:45

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.