Qmysql Driver Not Loaded Windows

  1. Qmysql Driver Not Loaded Windows 10
  2. Qmysql Driver Not Loaded Windows Xp
  3. Qt Mysql Driver Not Loaded
  4. Qpsql Driver Not Loaded
  5. Qsqldatabase Qmysql Driver Not Loaded Windows 10
  6. Qt Driver Not Loaded
  7. Qmysql Driver Not Loaded Windows 10
Active1 year, 3 months ago

How do I load qmysql driver in Qt? I have the following code that produces these results:

Any suggestions on how to load it?

Noam M

Why QMYSQL driver not loaded in QT5.2? Ask Question Asked 5 years, 6 months ago. Active 10 months ago. QMYSQL driver not loaded on windows 10. MySQL + Qt QMYSQL plug-in = commercial MySQL license? Why shouldn't I use mysql. functions in PHP? When I run the code QSqlDatabase: QMYSQL driver not loaded QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7 Database is Not Connected! QSqlDatabase: QMYSQL driver not loaded QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7 'Driver not loaded Driver not loaded' QSqlQuery::exec: database not open 'Driver not loaded Driver not loaded' QSqlQuery::value: not positioned on.

2,8575 gold badges21 silver badges37 bronze badges
Hannoun YassirHannoun Yassir
11k17 gold badges70 silver badges107 bronze badges

9 Answers

We should check our driver first

then we can find some files

Use the command below to check library

if you find the problem libmysqlclient_r.so.16 => not found it may be the library-dependency problem.

Many Windows 7 users are faced with an unpleasant glitch that causes the disappearance of the language bar from the taskbar, and the standard tools of the system fail to restore the layout indicator. Missing language bar windows 7.

Qmysql Driver Not Loaded Windows 10

After I did a little research on the Internet, there is a way would be easy.

if you find libmysqlclient_r.so.18,

rpax
3,9154 gold badges23 silver badges51 bronze badges
DesmondDesmond

ok it worked just by copying the sqldrivers folder to my debug folder and it worked!

Hannoun YassirHannoun Yassir
11k17 gold badges70 silver badges107 bronze badges

You could try diagnosing the issue with strace - it seems like the QMYSQL driver might need some run-time library dependencies to work.

qdotqdot
4,3292 gold badges36 silver badges90 bronze badges

Qmysql Driver Not Loaded Windows Xp

handlehandle
3,2722 gold badges29 silver badges58 bronze badges

You can use QPluginLoader to get some better error message.

When I had the same problem with the MySQL driver the message was something like 'The version was compiled with other options than this Qt version'.

It seemed like the Qt sources, that shipped with the Qt SDK at that time, were not compatible with its binaries.

After downloading the Qt sources and compiling my own version of Qt and the MySQL driver, the problem was gone.

EDIT: Some sample code.

Qt Mysql Driver Not Loaded

When compiling against 5.0.1 this is the output:

I also found the old message:

NiklasNiklas

The same problem I faced in fedora20 (64-bit) with Qt-5.2.0, and then follow steps:

Qpsql Driver Not Loaded

Use the command below to check library dependency:

I find the problem:

It may be the library-dependency problem. so solve this problem:

Linking of the library file:

and again:

Now its work for me.All the best

Hamid Rohani
9722 gold badges16 silver badges25 bronze badges
Rahul chand vermaRahul chand verma

Here a couple of very nice links on this issue:

  1. making the plugins manually on Unix-based systems (from Qt documentation):http://qt-project.org/doc/qt-5/sql-driver.html

  2. a very well-written link specifically on this issue (Do not forget to install the Qt from source, this can be done by either checking the corresponding (hidden) box in the first step while installing from the .run executable or by downloading the 'qt-everywhere-opensource-src' version):http://adamcavendish.is-programmer.com/posts/40431.html

Enjoy,Peyman

PeymanPeyman

Got the same problem and some Google research and intuition finally solved it.Using Qt5.9.1 and Ubuntu 17.10

First, check if the error of libmysqlclient.so.18 => not found is present

Second, search where is libmysqlclient

Belkin surf and share f7d2101 driver license. I have about 6 usb ports on my desktop and have tried everyone.

Third, go to the folder where libmysqlclient is present and there make the link

and check the link made before with

At that moment, none of those solved for me, and i decided to look further in synaptic packages, and realize that libqt5sql5-mysql version 5.9.1 was not installed, so installing it solved the problem but i still have a message when doing ldd

./libqsqlmysql.so: /usr/lib/x86_64-linux-gnu/libmysqlclient.so.18: version `libmysqlclient_18' not found (required by ./libqsqlmysql.so)

after that, found some links that guide me to a real solution, here are them, if you wanna know whats happening

i downloaded the library stated in the third link and worked like a charm. hope it helps!

Nicolas C. R.Nicolas C. R.
IngwarsmithIngwarsmith

Not the answer you're looking for? Browse other questions tagged mysqlqtqt5 or ask your own question.

Active6 years, 2 months ago

I have compiled qmysql driver plugin and placed debug and release .dll and .lib files in pluginssqldrivers. But when i try qDebug() << QSqlDatabase::drivers(); it still get ('QSQLITE', 'QODBC3', 'QODBC', 'QPSQL7', 'QPSQL')and QMYSQL driver is not available.Any idea?

Qt version : 4.8.4
Compiler : MSVC2010

OS : windows vista (64bit)

Hesam QodsiHesam Qodsi
8493 gold badges20 silver badges36 bronze badges

1 Answer

Your application needs libmysql.dll which you can find in the MySQL installation directory. You can copy it to the Qt bin directory or in the same directory of your .exe

Qsqldatabase Qmysql Driver Not Loaded Windows 10

Note that you need to restart your IDE (Qt Creator or what ever IDE) after you place new dll files in pluginssqldrivers or Qt bin directory.

Qt Driver Not Loaded

RamezRamez

Qmysql Driver Not Loaded Windows 10

Not the answer you're looking for? Browse other questions tagged qtqt4 or ask your own question.