Results 1 to 9 of 9

Thread: Driver not loaded Driver not loaded

  1. #1
    Join Date
    Oct 2012
    Posts
    12
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Exclamation Driver not loaded Driver not loaded

    I coding a program with Qt 4.8.4 and MySQL 5.5.(a non-install version mysql-5.5.29-win32)
    I using mysql as my database driver. Now it able to work properly on my computer, but can not be run on other computers. It prompts "Driver not loaded Driver not loaded"
    And I create a plugins file, including sqldrivers file(qsqlmysql4.dll) and codecs file(qcncodecs4.dll)
    Well I copy the libgcc_s_dw2-1.dll, libmysql.dll, mingwm10.dll, QtCore4.dll, QtGui4.dll, QtSql4.dll to my program's file
    Of course, my Qt supports "QSQLITE" "QMYSQL3" "QMYSQL" "QODBC3" "QODBC" drivers.

    I need your help, please.

  2. #2
    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: Driver not loaded Driver not loaded

    Hm, the error means normaly that libmysql.dll could not be found. So is libmysql.dll in the same directory as QtCore4.dll and also is libmysql.dll the library you used to build qsqlmysql4.dll?

  3. #3
    Join Date
    Dec 2012
    Posts
    90
    Thanks
    5
    Thanked 20 Times in 18 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Driver not loaded Driver not loaded

    Your qsqlmysql4.dll should be in 'Path_to_executable/sqldrivers/' folder for the program to run.
    I had similar issue when putting it into 'Path_to_executable/plugins/sqldrivers/' folder.

  4. #4
    Join Date
    Oct 2012
    Posts
    12
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Driver not loaded Driver not loaded

    I added this code:
    Qt Code:
    1. QString strLibPath(QDir::toNativeSeparators(QApplication::applicationDirPath()) + QDir::separator() + "plugins");
    2. app.addLibraryPath(strLibPath);
    To copy to clipboard, switch view to plain text mode 
    but there has the problem.
    What should I do??
    Last edited by Lykurg; 26th February 2013 at 14:23. Reason: changed [qtclass] to [code]

  5. #5
    Join Date
    Oct 2012
    Posts
    12
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Driver not loaded Driver not loaded

    Quote Originally Posted by Lykurg View Post
    Hm, the error means normaly that libmysql.dll could not be found. So is libmysql.dll in the same directory as QtCore4.dll and also is libmysql.dll the library you used to build qsqlmysql4.dll?
    libmysql.dll is in MySQL's lib, and I copy to my program file.
    libmysql.dll and qsqlmysql4.dll must copy to sqldrivers file??
    And now libmysql.dll in the same directory as QtCore4.dll, but there also has the problem.
    I don't know what you said.
    Last edited by Hughen; 26th February 2013 at 13:30.

  6. #6
    Join Date
    Feb 2013
    Posts
    19
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Driver not loaded Driver not loaded

    Hi for me on windows 7 it works like this:

    Driver not loaded means the sqldrivers folder cannot be located -> if i rename my sqldrivers folder i will get this error...

    my folder/path structur:

    libmysql.dll
    urProgramm.exe
    otherQtDlls.dll
    sqldrivers\qsqlmysql4.dll

    sqldrivers is a folder in the "exe" directory.

    That mean put the "libmysql.dll to ur exe and other qtdll´s like qtguidll.... put the sqldrivers Folder in the path where ur exe is located.


    I hope this helps you out of this.

    Greets Anenja

  7. #7
    Join Date
    Oct 2012
    Posts
    12
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Driver not loaded Driver not loaded

    Thanks.
    just now I also use your advice to get access to load drivers, and it works well.
    Thanks again.

  8. #8
    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: Driver not loaded Driver not loaded

    Hyghen, where have you get that your programm supports "QSQLITE" "QMYSQL3" "QMYSQL" "QODBC3" "QODBC"? If it is on the "other" computer, then qsqlmysql4.dll is places correctly.

    Have you tried to use Dependency Walker to see what library is actually missing?

  9. #9
    Join Date
    Oct 2012
    Posts
    12
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Driver not loaded Driver not loaded

    Of course, I get them by my computers(Qt 4.8.4+MySQL 5.5).
    And all problems is solved, the qslqmysql4.dll is in sqldrivers file, the libmysql.dll must be in the program file.
    In other words, libmysql.dll copy to root directory of main_program_run.exe
    Thanks your help.
    Nice to you.

Similar Threads

  1. App found qsqlite4.dll driver file but still "Driver not loaded"
    By merelendor in forum Installation and Deployment
    Replies: 2
    Last Post: 17th August 2011, 11:15
  2. Help with QMYSQL driver for QT 4.4.0: driver not loaded
    By khikho in forum Installation and Deployment
    Replies: 4
    Last Post: 1st April 2011, 15:00
  3. db driver not loaded
    By mak_user in forum Newbie
    Replies: 1
    Last Post: 3rd March 2011, 05:25
  4. Replies: 1
    Last Post: 24th April 2010, 03:43
  5. Driver not loaded
    By rogerio in forum Installation and Deployment
    Replies: 8
    Last Post: 16th May 2009, 07:07

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.