Since the Qt Company doesn't ship the MYSQL/MARIADB SQL driver with the Qt binaries "Due to the practicalities of dealing with external dependencies, only the SQLite plugin is shipped with binary builds of Qt", it has to be built manually. This repository provides scripts to build the driver and precompiled binaries for Windows, Linux, and macOS.
- Fork the GitHub repository.
- Checkout on the desired branch (qt5 or qt6).
- Change the Qt version in
.github/workflows/build.yml
. - Get the binaries in the GitHub Actions artifacts.
- Install the necessary dependencies for MariaDB.
- Call the script with the Qt version as a parameter
or
./build.sh 5.15.2
./build_win.sh 5.15.2
- Put the libqsqlmysql.so, libqsqlmysql.dylib or qsqlmysql.dll in folder
plugins/sqldriver
inside the Qt installation or alongside the executable (application deployment). - Put libmariadb.so, libmariadb.dylib or libmariadb.dll alongside the application executable (necessitates OpenSSL libraries).