Results 1 to 2 of 2

Thread: Problem with MySQL drive on mac

  1. #1
    Join Date
    Jun 2018
    Qt products
    MacOS X Windows

    Default Problem with MySQL drive on mac

    I am working on MySQL database on mac, run program generates the following error.

    QSqlDatabase: QMYSQL driver not loaded
    QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QPSQL QPSQL7

    I have MySQL installed on my computer (macOS high Sierra) that has the following driver libmysqlclient.20.dylib. The MySQL path is the following:


    I have executed the following code:

    cd /Users/eduardo/Qt/5.11.1/clang_64/plugins/sqldrivers
    otool -L 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.1)
    @rpath/QtCore.framework/Versions/5/QtCore (compatibility version 5.11.0, current version 5.11.1)
    /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)

    Does anyone know how I can connect to my database?
    I have researched in the net and I have found that it is used, install_name_tool –change ,although I am not sure what it is for. I have tried this but obviously something is wrong.
    install_name_tool – change /usr/local/mysql/lib/libmysqlclient.20.dylib /usr/local/mysql-8.0.15-macos10.14-x86_64/lib/libmysqlclient.20.dylib /Users/eduardo/Qt/5.11.1/clang_64/plugins/sqldrivers/libqsqlmysql.dylib

    Thanks for help.
    Attached Images Attached Images

  2. #2
    Join Date
    Jan 2019
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Unix/X11 Windows

    Default Re: Problem with MySQL drive on mac

    I dont know how much this will help, but I spent all day on same issue on Windows...
    after so many topis on the google that if you are using QT 32bit, you need to install 32bit connector I proved to be wrong.

    It depends on your compiler.
    I was using MSVC/MINGW 64bit with mysql 32bit connector and had EXACTLY same issue.
    after all day installing different versions of 332bit mysql connector (because I thought I have to have 32bit connector as I am using 32bit Qt Creator) i switched to 32b compilers and suddently it started to works like charm...

    Later I did the same with SSL, however there I proven I have to use 64bit SSL as my OS is

Similar Threads

  1. Replies: 2
    Last Post: 9th December 2015, 01:07
  2. Drive sql
    By lucasbemo in forum Newbie
    Replies: 3
    Last Post: 4th November 2010, 18:33
  3. MySql problem
    By MrShahi in forum Installation and Deployment
    Replies: 1
    Last Post: 25th May 2008, 00:18
  4. MySql Problem
    By vishesh in forum Installation and Deployment
    Replies: 7
    Last Post: 19th April 2007, 21:16
  5. problem of how to get drive
    By jyoti in forum General Programming
    Replies: 6
    Last Post: 30th November 2006, 14:18


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.