[SOLVED] MySQL-Plugin for QT 5.3.1 under OsX 10.9
-
Hello, i hope somebody can help me - i just invested like 3 days and 4 nights without any success trying to build the mysql drivers for QT on my mac osx 10.9 mavericks
I got an Debian Linux (wheezy) server running the MySQL-community edition (mysql-server_5.6.20-1debian7_amd64.deb-bundle.tar)
i have QT 5.3.1 (qt-opensource-mac-x64-android-ios-5.3.1.dmg)
when i try to build/run a program i got the following issue:
QSqlDatabase: QMYSQL driver not loaded
QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7i tried nearly everything but now i am on a state on like completely starting again
can someone maybe help me on a clean installation of the correct packages of QT and so on to be able to run a mysql connection to a different host including building the mysql-plugin to connect to that different host ?
thanks in advance B.
-
Hi and welcome to devnet,
please run otool -L on your Qt mysql plugin, see if you have a line stating that it doesn't find something. More specifically the MySQL client library.
-
hello sGaist,
thanks for a fast reply
i did a
cd /Applications/QT5.3.1/5.3/clang_64/plugins/sqldrivers/
otool -L libqsqlmysql.dylibthe output was:
libqsqlmysql.dylib:
libqsqlmysql.dylib (compatibility version 0.0.0, current version 0.0.0)
/opt/local/lib/mysql55/mysql/libmysqlclient.18.dylib (compatibility version 18.0.0, current version 18.0.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
/Applications/Qt5.3.1/5.3/clang_64/lib/QtSql.framework/Versions/5/QtSql (compatibility version 5.3.0, current version 5.3.1)
/Applications/Qt5.3.1/5.3/clang_64/lib/QtCore.framework/Versions/5/QtCore (compatibility version 5.3.0, current version 5.3.1)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 56.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0) -
/opt/local/lib/mysql55/mysql/libmysqlclient.18.dylib
Do you have that file on your computer ?
-
no i don't have that
i have those folders on my macApplications Users dev net usr
Library Volumes etc private var
Network bin home sbin
System cores mach_kernel tmpno opt.
also i don't have mysql installed on my mac only on the debian-server
-
You need the MySQL client libraries in order to load the plugin. You can install them through e.g. macports/brew or the official MySQL package
-
do you have a link where to download the macports/brew Mysql client ? couldn't find them on the net
-
macports and brew are package manager for OS X, install one of them, and from there install MySQL
-
ok what i did
i downloaded: https://distfiles.macports.org/MacPorts/MacPorts-2.3.1-10.9-Mavericks.pkginstalled it
then i opened a terminal and entered:xcode-select --install
after that i entered:
sudo port install qt5-mac-mysql56-plugin
but i still get the same error :
QSqlDatabase: QMYSQL driver not loaded
QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7shall i do a
sudo port install mysql56
or
sudo port install mysql56-server
??
-
With that command you installed the Qt 5 version from macport. So you probably have also MySQL 5.6 already installed
-
sorry sgaist - is that a question? i am not sure ?
as mentioned before
i have a debian server running mysql community server
i got a macbook with QT 5.3.1 creator on it
i want to open a connection from the macbook to the mysql community server on the debian server
i am not sure if this is working ..
maybe it is better to start from the beginning
so which version of the QT 5 shall i download an install on my macbook ? -
port installed | grep - i mysql
brought up this:
mysql56 @5.6.19_1 (active)
mysql56-server @5.6.19_1 (active)
mysql_select @0.1.2_0 (active)
qt5-mac-mysql56-plugin @5.3.1_0 (active)in /opt/local/lib/mysql56/mysql
was:libmysqlclient.18.dylib
libmysqlclient.a
libmysqlclient.dylib
libmysqlclient_r.18.dylib
libmysqlclient_r.a
libmysqlclient_r.dylib
libmysqld.a
libmysqlservices.a -
So you have what is need. No the only thing is that your plugin point to mysql55 and not mysql56.
Have a look at the install_name_tool command to change that in your plugin
-
how do i change that ?
-
By using the install_name_tool command
-
can u tell me where do i find this tool and how do i use it?
never heard of that before .. still searching on google
-
It's an OS X command line tool
There are several posts on this forum that mention it on problem similar to yours
-
really i found lot of articles on google - but i really have no clue how to use that tool ..
can you maybe give me a hint please?
thanks in advance -
in a console write
@man install_name_tool@
Everything is explained