[SOLVED] QSqlDatabase: QMYSQL driver not loaded with QMYSQL driver available in OSX Mavericks
-
wrote on 8 Aug 2017, 18:27 last edited by
Hello SGiant, I am new to QT and have been trying to work with database using MYSQL for last few days, but am getting the same errors as others, i.e. "Driver not loaded Driver not loaded".
I tried copying libmysqlclient.20.dylib from ~/usr/local/Cellar/mysql/5.7.19/lib to ~/opt/local/lib/mysql55/mysql but nothing happened. (I don't know how to use install_name_tool).Please help me out.
Thank You. -
Hi @Day-Reloader and welcome to devnet,
There's an example of how to use
install_name_tool
in this very thread in one of the answer of @Orbotron. -
wrote on 29 May 2018, 11:15 last edited by
I have a new problem. When I type "otool -L libqsqlmysql.dylib" in the terminal, the reply is /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/objdump: 'libqsqlmysql.dylib': No such file or directory
However, the fact is I have the file "libqsqlmysql.dylib" in the sqldrivers.
How do I solve this problem? -
Hi and welcome to devnet,
Either you have to be in the same folder as the file you want to analyse or pass the full path to it.
-
Hi and welcome to devnet,
Either you have to be in the same folder as the file you want to analyse or pass the full path to it.
wrote on 29 May 2018, 11:56 last edited by@SGaist
amazing!! I have finished that step. But what about the next step?
I have searched the Internet about the some approaches to solve the driver problem, but I don't know which is correct.
PLZ -
Hi and welcome to devnet,
Either you have to be in the same folder as the file you want to analyse or pass the full path to it.
wrote on 29 May 2018, 12:19 last edited by@SGaist more details:
~/Qt/5.11.0/clang_64/plugins/sqldrivers otool -L libqsqlmysql.dylib
libqsqlmysql.dylib:
libqsqlmysql.dylib (compatibility version 0.0.0, current version 0.0.0)
@rpath/QtSql.framework/Versions/5/QtSql (compatibility version 5.11.0, current version 5.11.0)
@rpath/QtCore.framework/Versions/5/QtCore (compatibility version 5.11.0, current version 5.11.0)
/System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
/usr/local/mysql/lib/libmysqlclient.20.dylib (compatibility version 20.0.0, current version 20.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 307.5.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.50.2) -
The output looks nice. What is the problem ?
-
wrote on 30 May 2018, 08:54 last edited by
I don't know the problems exactly. However ,I use the approaches which was published in the stackoverflow to solve this question.
I typed the phrase"install_name_tool -change libmysqlclient.20.dylib /usr/local/mysql/lib/libmysqlclient.20.dylib libqsqlmysql.dylib" in the Terminal, and then it worked!!!!!!
When I connect MySql to QT, I faced the problem about the permission. Then I changed the "hostname" and in the last , I can use QT to edit the Mysql database.
Thx!!!!