Hello All,

I’m just starting out with Qt on Mac OSX 10.14.5 Mojave, and I’ve been having a terrible time getting past the issue “QMYSQL driver not loaded”. I know from my searching that this is something a lot of people have trouble with, and I’ve tried just about everything I found online. This morning I had to wipe everything on the computer, so I’m starting fresh without any leftovers from previous attempts. Because of this, I won't list out everything I've tried.
Here’s what I’ve done today:

-Installed MySQL Community Server 8.0.16 using the DMG installer.
-Installed Xcode via the App Store
-Installed Qt Open Source using the default installer on the qt.io downloads page; when prompted to choose components, chose under 5.12.3 “macOS” and “sources”, and left “Developer and Designer Tools” alone.

Opening up Qt Creator works fine. I opened the ‘Books’ example project and it runs fine. But, when I add the line:
Qt Code:
  1. QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
To copy to clipboard, switch view to plain text mode 

I get the error:
QSqlDatabase: QMYSQL driver not loaded
QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7

Anyway, I started to follow the guide here https://doc.qt.io/qt-5/sql-driver.html

Qt Code:
  1. $ cd Qt/5.12.3/clang_64/plugins/sqldrivers/
  2. $ qmake -- MYSQL_PREFIX=/usr/local
  3. -bash: qmake: command not found
To copy to clipboard, switch view to plain text mode 
For whatever reason qmake didn't end up on the PATH so I added it and it seemed to work:
Qt Code:
  1. $ echo $PATH
  2. /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
  3. $ export PATH=$PATH:/Users/ebm/Qt/5.12.3/clang_64/bin
  4. $ qmake --version
  5. QMake version 3.1
  6. Using Qt version 5.12.3 in /Users/ebm/Qt/5.12.3/clang_64/lib
To copy to clipboard, switch view to plain text mode 
but now when I try qmake -- MYSQL_PREFIX=/usr/local again, I just get the help menu.

Qt Code:
  1. $ qmake -- MYSQL_PREFIX=/usr/local
  2. Usage: qmake [mode] [options] [files]
  3.  
  4. QMake has two modes, one mode for generating project files based on
  5. some heuristics, and the other for generating makefiles. Normally you
  6. shouldn't need to specify a mode, as makefile generation is the default
  7. mode for qmake, but you may use this to test qmake on an existing project
To copy to clipboard, switch view to plain text mode 
(etc)

I don't get why this is happening. I definitely got this command to execute (albeit unsuccessfully) before I had to wipe my machine, but now it isn't actually doing anything. Why not?

Any help is really appreciated. I'm totally new to all of this and I'm getting confused and kind of frustrated.