Page 1 of 2 12 LastLast
Results 1 to 20 of 40

Thread: MySQL Driver not loaded on PC without Qt

  1. #1
    Join Date
    Sep 2010
    Posts
    21
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default MySQL Driver not loaded on PC without Qt

    hi,

    first of all: i'm native german so bear please with me if my english looks strange sometimes

    i wrote an application which communicates with a mysql-server.
    everything works fine on my pc, but when i want to use it on a pc without Qt, the mysql-driver is missing.
    i copied the qsql_mysql4.dll in the application path, but it still won't work.

    so i tried something else: i copied the dll in the application path on my machine and renamed the library in the /qt/plugins/sqldrivers-path aaaaand: my computer is also unable to connect to the server because of the missing driver.
    my app searches only in /qt/plugins/sqldrivers and nowhere else.

    i also tried to add library path using the addLibraryPaths()-method without success.

    i could compile the application completely static to make it work, but there has to be a better solution for this.

    is there a way to change that behaviour?

  2. #2
    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 not loaded on PC without Qt

    Scroll the webpage down until you see a section called "Similar Threads". Click and enjoy.
    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.


  3. #3
    Join Date
    Sep 2010
    Posts
    21
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: MySQL Driver not loaded on PC without Qt

    i tried everything mentioned on the other threads except clearing the cache before. (tried to copy the sqldriver-folder into the app-folder, even the whole plugins-folder didn't change anything)
    but i don't think clearing would help since i'm able to use the driver as long as it is in qt/plugins/sqldrivers/ .
    i just don't get what is wrong :/

  4. #4
    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 not loaded on PC without Qt

    Quote Originally Posted by KTvsPeacock View Post
    tried to copy the sqldriver-folder into the app-folder
    So how exactly does the file/folder structure look like? Assuming your application is installed in /App and is called "app"...

    /App/app.exe
    /App/???
    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.


  5. #5
    Join Date
    Sep 2010
    Posts
    21
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: MySQL Driver not loaded on PC without Qt

    structure:
    1st try:
    /App/app.exe
    /App/QtCore4.dll
    /App/QtGui4.dll
    /App/QtNetwork4.dll
    /App/QtSql4.dll
    /App/QtWebkit4.dll
    /App/QtXmlPatterns4.dll

    /App/qsqlmysql4.dll


    2nd try:

    /App/app.exe
    .
    .
    .
    /App/sqldrivers/qsqlmysql4.dll

    3rd try:
    /App/app.exe
    .
    .
    .
    /App/plugins/sqldrivers/qsqlmysql4.dll

    everytime i got the message that the driver is missing, if its also removed from the qt-path

  6. #6
    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 not loaded on PC without Qt

    Then read the first of "similar threads" careful! First answer is your solution. You are missing an important library for MySQL (and this was a BIG hint...)!

  7. #7
    Join Date
    Sep 2010
    Posts
    21
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: MySQL Driver not loaded on PC without Qt

    you mean the libmysql.dll right?
    sorry, i just forgot to mention it, but it was already in the app-folder.
    Last edited by KTvsPeacock; 16th September 2010 at 12:51.

  8. #8
    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 not loaded on PC without Qt

    If you are using the "Qt Sdk" (libraries+Creator) release of Qt be sure you copy files from the right directory.
    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.


  9. #9
    Join Date
    May 2010
    Location
    slovakia
    Posts
    47
    Thanks
    10
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Maemo/MeeGo

    Default Re: MySQL Driver not loaded on PC without Qt

    i got a same problem... on my machine i can find following

    locate qt|grep -i mysql
    /usr/include/qt4/Qt/qsql_mysql.h
    /usr/include/qt4/QtSql/QMYSQLDriver
    /usr/include/qt4/QtSql/QMYSQLResult
    /usr/include/qt4/QtSql/qsql_mysql.h
    /usr/lib/qt4/plugins/sqldrivers/libqsqlmysql.so
    /usr/share/doc/libqt4-sql-mysql
    /usr/share/doc/libqt4-sql-mysql/LGPL_EXCEPTION.txt
    /usr/share/doc/libqt4-sql-mysql/changelog.Debian.gz
    /usr/share/doc/libqt4-sql-mysql/changelog.gz
    /usr/share/doc/libqt4-sql-mysql/copyright
    /var/lib/dpkg/info/libqt4-sql-mysql.list
    /var/lib/dpkg/info/libqt4-sql-mysql.md5sums

    is the /usr/lib/qt4/plugins/sqldrivers/libqsqlmysql.so right library???

  10. #10
    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 not loaded on PC without Qt

    Huh, are we now talking about Linux? Wasn't it windows in the first

    EDIT: Ah, different guy! You are targeting which distro? The most have qt installed, so you normally don't need to deliver the Qt libraries along your application.

    EDIT 2: Yeah, noticed that. Took a while...

  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 not loaded on PC without Qt

    It's another guy.
    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. #12
    Join Date
    Sep 2010
    Posts
    21
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: MySQL Driver not loaded on PC without Qt

    i'm using the qt sdk and i took the dll from the qt/bin-folder (except the qsqlmysql4.dll of course).

    doesn't QApplication only looks in the given library paths for plugins?
    normally it searches in qt/plugins/ and the app-folder. i removed both using setLibraryPath(""), but still the qsqlmysql4.dll in qt/plugins was found and used. this is confusing

  13. #13
    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 not loaded on PC without Qt

    The plugin has to reside in a sqldrivers subdirectory of the directory containing the binary of your application.
    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.


  14. #14
    Join Date
    Sep 2010
    Posts
    21
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: MySQL Driver not loaded on PC without Qt

    you mean like this:

    "2nd try:

    /App/app.exe
    .
    .
    .
    /App/sqldrivers/qsqlmysql4.dll"

    i already tried this :/

  15. #15
    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 not loaded on PC without Qt

    Maybe you were missing something else too, like the MySQL client library.
    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.


  16. #16
    Join Date
    Sep 2010
    Posts
    21
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: MySQL Driver not loaded on PC without Qt

    Isn't this the libmysql.dll?
    It's in the /App-folder. If I try to put it somewhere else, the application won't start.
    Somewhere has to be an entry that tells something like "look only in qt/plugins for plugins no matter what you're supposed to do".
    Last edited by KTvsPeacock; 17th September 2010 at 14:34.

  17. #17
    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 not loaded on PC without Qt

    Quote Originally Posted by KTvsPeacock View Post
    It's in the /App-folder. If I try to put it somewhere else, the application won't start.
    It should start. Your main application shouldn't depend on the mysql client library. What does dependency walker say?
    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.


  18. #18
    Join Date
    Sep 2010
    Posts
    21
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: MySQL Driver not loaded on PC without Qt

    You were right: it starts without libmysql.dll.
    It depends on kernel32, mingwm10, msvcrt, libgcc_s_dw2-1, qtcore4, qtgui4, qtsql4, and qtwebkit4.dll

    ///
    This is what I get, when I call the libraryPaths()-method of my application:
    ("D:/Programme/Qt/qt/plugins", "C:/Release/nV/release")
    So I removed the first path calling removeLibraryPath("D:/Programme/Qt/qt/plugins").
    Called librayPath() again, got only the second path and still the application took the dll from the removed path.

  19. #19
    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 not loaded on PC without Qt

    But what exactly is the problem with the first path being there?
    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.


  20. #20
    Join Date
    Sep 2010
    Posts
    21
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: MySQL Driver not loaded on PC without Qt

    The problem is that my Application only searches in that path, no matter what, for plugins.
    I could add thousand additional paths and put the needed dll in every single one of them, but only the one lies in the qt/plugins-path will be used.
    And this is not that good, if I want to use my application on a PC without Qt :/

Similar Threads

  1. mysql driver not loaded after deployment
    By tpf80 in forum Newbie
    Replies: 4
    Last Post: 4th September 2011, 11:12
  2. MySQL driver , I have, it still not loaded
    By bigkoma in forum Qt Programming
    Replies: 14
    Last Post: 30th January 2011, 11:38
  3. Sql Driver: MYSQL not loaded
    By stilgar in forum Qt Programming
    Replies: 2
    Last Post: 15th June 2010, 11:35
  4. MySQL driver not loaded
    By hami in forum Installation and Deployment
    Replies: 1
    Last Post: 12th May 2009, 20:54
  5. MySql Driver not loaded
    By eekhoorn12 in forum Installation and Deployment
    Replies: 13
    Last Post: 18th June 2007, 14:57

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.