Qsqldatabase Qpsql Driver Not Loaded

Loaded

I want to load qt5 psql driver in windows 7. I've load the library as this way: qDebug QSqlDatabase::addDatabase(driverName,'A connection to postgres'); And the output shows. Note: Some drivers, such as the QPSQL driver, may may require you to pass tablename in lower case if the table was not quoted when created. See the Qt SQL driver documentation for more information. static void QSqlDatabase:: registerSqlDriver (const QString & name, QSqlDriverCreatorBase. creator ).

Hello

Not

QSqlDatabase: QMYSQL driver not loaded QSqlDatabase: available drivers: QMYSQL Since the Qt Company currently doesn't give a crap on providing qsqlmysql.dll in binary form, you have to build it on your own, which can be a pain. Here is a build for various. @nkbartc said in QSqlDatabase: QPSQL driver not loaded. I checked 'D: Qt 5.14.0 msvc201764 plugins sqldrivers qsqlpsqld.dll' and I did found the dll which the debugger reports as missing. QSqlDatabase: QPSQL driver not loaded QSqlDatabase: available drivers: QSQLITE QMYSQL QMARIADB QODBC QPSQL Could not create database object While navigating the results in forward-only mode, the handle of QSqlResult may change.

I'm relatively new to QT and C++.

I've experience in PHP (OOP), Webdevelopement and C.
Just for imagine with whom you are working with ;).

I'm working on windows 7 64 Bit.
QT 5.10.0 and Visual Studio Community 2017 15.5.1.

I'm working here with somebody who created a program which connects to a PostgresSQL 9.3 all works fine for him. So now I just want to support him and installed everything (already multiply times).

But I always get the same error:
'QSqlDatabase: QPSQL driver not loaded
QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7'

I already tried to build the driver by my self but there are many things different to the instructions and got a lot of errors.
Then I loaded the books example (http://doc.qt.io/qt-5/qtsql-books-example.html) it just works fine.

Now I change this to QPSQL and I get the exactly same error.

I don't know if I'm correct but i'm thinking I should get something like 'Wrong username/password can't connect' or 'Can't connect to database' instead of the driver....
=> Ok just tested.... my workmate (where it is working) get another message the one I would expect...

So I already tried everything I'm able to.

Anyone any idea what I should do?
I just want that the driver works!

Thank you very much

Hi all,

I'm getting crazy with QMYSQL :(. I want to connet to a mysql server through this code (for testing the connection only). Qt version is 5.2.1, while OS is Ubuntu 13.10.

@
#include <QCoreApplication>

#include <QtSql/QSqlDatabase>
#include <QtSql/QSqlError>

#include <QDebug>

int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
qDebug() << 'Started';
qDebug() << 'library path ' << a.libraryPaths();

}
@

I get the following output:

Started
library path ('/home/fabio/Qt/5.2.1/gcc/plugins', '/home/fabio/Tests/Qt/build-TestDatabase-Desktop_Qt_5_2_1_GCC_32bit-Debug')
('QSQLITE', 'QMYSQL', 'QMYSQL3', 'QPSQL', 'QPSQL7')
available = true
db error= 'Driver not loaded'
driver error= 'Driver not loaded'
done= false
Failed to open database

  • db error= 'Driver not loaded'
  • driver error= 'Driver not loaded'
    Terminating

As you can see, driver is not loaded, even if all libs are at the correct places and dependencies are satisfied.

This is the past of the plugin dependencies
fabio@ubuntu:~$ ldd /home/fabio/Qt/5.2.1/gcc/plugins/sqldrivers/libqsqlmysql.so
linux-gate.so.1 => (0xb77de000)
libmysqlclient.so.18 => /usr/lib/i386-linux-gnu/libmysqlclient.so.18 (0xb7492000)
libQt5Sql.so.5 => /home/fabio/Qt/5.2.1/gcc/lib/libQt5Sql.so.5 (0xb7453000)
libQt5Core.so.5 => /home/fabio/Qt/5.2.1/gcc/lib/libQt5Core.so.5 (0xb6f89000)
libstdc++.so.6 => /usr/lib/i386-linux-gnu/libstdc++.so.6 (0xb6ea0000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb6cec000)
libz.so.1 => /lib/i386-linux-gnu/libz.so.1 (0xb6cd2000)
libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xb6ccd000)
libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xb6cb1000)
libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xb6c6e000)
libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xb6c51000)
libicui18n.so.51 => /home/fabio/Qt/5.2.1/gcc/lib/libicui18n.so.51 (0xb6a2f000)
libicuuc.so.51 => /home/fabio/Qt/5.2.1/gcc/lib/libicuuc.so.51 (0xb68b6000)
libgthread-2.0.so.0 => /usr/lib/i386-linux-gnu/libgthread-2.0.so.0 (0xb68b2000)
librt.so.1 => /lib/i386-linux-gnu/librt.so.1 (0xb68a9000)
libglib-2.0.so.0 => /lib/i386-linux-gnu/libglib-2.0.so.0 (0xb67a5000)
/lib/ld-linux.so.2 (0xb77df000)
libicudata.so.51 => /home/fabio/Qt/5.2.1/gcc/lib/libicudata.so.51 (0xb525c000)
libpcre.so.3 => /lib/i386-linux-gnu/libpcre.so.3 (0xb521a000)

and, in the turn, the pasting of libmysqlclient which the plugin depends on:

fabio@ubuntu:~$ ldd /usr/lib/i386-linux-gnu/libmysqlclient.so.18
linux-gate.so.1 => (0xb773a000)
libz.so.1 => /lib/i386-linux-gnu/libz.so.1 (0xb73e6000)
libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xb73e1000)
libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xb73c5000)
libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xb7382000)
libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xb7365000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb71b1000)
/lib/ld-linux.so.2 (0xb773b000)

To be more precise, I have built the plugin directly from source code (5.2.1) and the database mentioned in the code really exists on 127.0.0.1.

I also tried with QMYSQL3 (same result).

I really don't know what else to check.
Please help me

Qsqldatabase Qpsql Driver Not Loaded Windows 10

Thanks in advance
Fabio