I have been trying to connect to a remote SQL database with Qt 6.5.2, using QtSql which came included with Qt. The SQLite driver (already installed) won't allow me to connect to a remote SQL database, so I've tried downloading the MySQL and QPSQL drivers which can connect remotely and in both cases it kept giving me the error
QSqlDatabase: QPSQL driver not loaded
QSqlDatabase: available drivers: QSQLITE QODBC QPSQL
Error: Could not open database
I have downloaded the qsqlpsql.dll file in the application directory and project directory - as well as in the /plugins/sqldrivers/ folder, but i still have this error. Can someone please help? I have seen other people with the "driver not loaded" error but they usually had compatibility errors, but there is none of that to be seen as far as I'm aware.
P.S. I have also tried downloading on RHEL9 - which is the OS that the sql database is on - but i don't think that is too relevant