Solved Dreaded Mysql drivers not loaded problem
-
I know there are countless posts about this. I have read numerous and cannot figure out where I am going wrong.
Environment:
Mac OS Catalina
Latest QT Creator and Mysql downloads.I have a project on windows and it works fine, deployment is finally working.
I am now trying to deploy on a mac however I cannot get the program working.
I have it running and no error however cannot get the dreaded Mysql connection working.
I am not sure where to go next.
The plugins trace is Cannot load library /Users/macos/QT/5.9.9/clang_64/plugins/sqldrivers/libqsqlmysql.dylib Library not loaded: /usr/local/mysql/lib/libmysqlclient.20.dylib
Now this is strange considering I have libmysqlclient.21.dylib and the install_name_tool command I ran was -change libmysqlclient.21.dylib /usr/local/mysql/lib/libmysqlclient.21.dylib /Users/macos/Qt/5.9.9/clang_64/plugins/sqldrivers/libqsqlmysql.dylib
Any advise?
-
Got it working thanks.
https://forum.qt.io/topic/82663/qmysql-driver-not-loaded-on-mac/41
near the bottom helped me understand it. I had to rename the library to 20 in the mysql(pointer?) directory from the main mysqlXXXX directory.
Thanks,
--James -
Hi,
You need to provide the correct entry to be replaced not just the library file name.
-
@SGaist I apologize but I do not have any experience with mac.
I am unsure what you mean by that?
Thanks,
--James -
Your install_name_tool call is wrong. When you want to change a path to a library you have to provide the complete entry you want to replace.
-
Got it working thanks.
https://forum.qt.io/topic/82663/qmysql-driver-not-loaded-on-mac/41
near the bottom helped me understand it. I had to rename the library to 20 in the mysql(pointer?) directory from the main mysqlXXXX directory.
Thanks,
--James -
Do you mean you changed a file name on your disk ? If so then you are doing it wrong.