Skip to content

Pre-built QMYSQL driver for Qt using MariaDB. Available for Windows, Linux and MacOS.

Notifications You must be signed in to change notification settings

bgallois/QMYSQL_driver_prebuilt

Repository files navigation

QMYSQL driver pre-built

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.

Automatic compilation

  • 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.

Manual compilation

  • Install the necessary dependencies for MariaDB.
  • Call the script with the Qt version as a parameter
    ./build.sh 5.15.2
    
    or
    ./build_win.sh 5.15.2
    

Deployment

  • 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).