i'm using
os x: 10.12.4
qt creator 4.0.2
mysql 5.0.12 (looks that, not sure)
c++
under qt trying connect mysql database following code:
qsqldatabase db = qsqldatabase::adddatabase("qmysql"); db.sethostname("sql104.rf.gd"); // 185.27.134.10 //db.setport(3306); db.setusername("correctname"); db.setpassword("correctpw"); db.setdatabasename("rfgd_19926673_shop"); if (db.open()){ ui->label->settext("success"); } else { i->label->settext("fail"); }
and fails with
qsqldatabase: qmysql driver not loaded qsqldatabase: available drivers: qsqlite qmysql qmysql3 qodbc qodbc3 qpsql qpsql7
i've tried no result
qpluginloader loader; loader.setfilename("/users/ivan/qt/5.7/clang_64/plugins/sqldrivers/libqsqlmysql.dylib");
it returns
cannot load library /users/ivan/qt/5.7/clang_64/plugins/sqldrivers/libqsqlmysql.dylib: (dlopen(/users/ivan/qt/5.7/clang_64/plugins/sqldrivers/libqsqlmysql.dylib, 5): library not loaded: /opt/local/lib/mysql55/mysql/libmysqlclient.18.dylib referenced from: /users/ivan/qt/5.7/clang_64/plugins/sqldrivers/libqsqlmysql.dylib reason: image not found) /users/ivan/build-courierhelperdesktop-desktop_qt_5_7_0_clang_64bit-release/courierhelperdesktop.app/contents/macos
i've got only
/usr/local/mysql-5.7.17-macos10.12-x86_64/lib/lib/mysqlclient.20.dylib
have tried
mkdir /opt/local/lib/mysql55/mysql/ cp /usr/local/mysql-5.7.17-macos10.12-x86_64/lib/lib/mysqlclient.20.dylib /opt/local/lib/mysql55/mysql
no help.
please, somebody, me out. stuck.
Comments
Post a Comment