Solved QSqlDatabase: QMYSQL3 driver not loaded?
-
Hi,
I am running the sqlbrowser example project, which connects fine with SQLITE but not with MYSQL. I get this error:QSqlDatabase: QMYSQL3 driver not loaded
What could be going on?
Thanks
Juan -
@jdent
Hi,which version of QT are you using?
For Qt5.5 i dont know a QMYSQL3 driver. Do you mean QMYSQL? -
I am using Qt 5.5.1 and I get same error whether I choose QMYSQL or QMYQL3..
I modified the *.pro by adding:
wince {
DEPLOYMENT_PLUGIN += qsqlite
# JDH added next
DEPLOYMENT_PLUGIN += mysql
}
to no avail...?
-
Sorry, a mistake. Correct modification to *.pro is:
wince {
DEPLOYMENT_PLUGIN += qsqlite
# JDH added next
DEPLOYMENT_PLUGIN += qmysql
} -
-
Did the change suggested but error is the same....
-
Hi,
Do you have the MySQL client library installed ?
-
Well, I see the files libqsqlmysql.dylib and libqsqlmysql_debug.dylib in the folder ~/Qt5.5.1/5.5/clang_64/plugins/sqldrivers so I guess it is installed??
-
No, those are the Qt plugins. You need to verify that your OS has the MySQL client libraries installed.
-
Well I can run Mysql workbench correctly... does not that mean the client tools are installed?
-
No, it does not. Are you running OS X ?
-
YES OS X 10.11.3
-
Then unless you installed it using brew/macports or the official MySQL package. You won't have the client library.
-
how can I ensure that I have the client libraries?
-
Hi,
I apologise for making a question that probably should be answered by MySQL web site but I have not found any answer .. maybe someone that has a lot of experience with MySql can find it very easy to direct my attention to where I can figure out if the client library is available. Does it need to be in a PATH or another environment variable? Do I place that in bash_profile or bashrc?
I downloaded the mysql-connector-c-6.1.6-osx10.8-x86_64 source and it has the following libraries in the lib subdir:
libmysqlclient.a
libmysqlclient.dylib
libmysqlclient.18.dylib
libmysqlclient_r.a
libmysqlclient_r.dylib
libmysqlclient_r.18.dylibHow do I put them so Qt Creator will find them? These ARE the client libraries right?
Thanks again!!
Juan -
Yes, these are the client libraries.
Now run
otool -L path/to/qsqlmysql.dylib
. You will get the list of dependencies of the plugin with an entry concerning the MySQL client library. You will have to runinstall_name_tool -change current/path/to/client_library your/path/to/client/library qsqlmysql.dylib
-
@SGaist Your help, once again!!! I am deeply grateful...
Problem solved!!Juan