I followed these steps for building QMySQL Plugin as mentioned in this post but it seems there is something wrong with Qt 5.9.1!
- install the development versions of the packages found above (libssl-dev, mysql-client-dev or similar).
- run the MaintenanceTool from your Qt installation, and be sure to select to install Qt's source code too.
- Go in QTDIR/5.9.1/Src/qtbase/src/plugins/sqldrivers/mysql/.
- Run the right qmake, i.e. the one coming from that installation of Qt (not the system wide one or similar). Best way to be sure is providing the full path to it: QTDIR/5.9.1/gcc_64/bin/qmake.
- Run make. Hopefully this will just work™; if it complains about some missing libraries, install them and rerun make.
- This should now have produced a new libqsqlmysql.so plugin; overwrite the old one with this new one.
$ /home/mogla/.Qt/5.9.1/gcc_64/bin/qmake Cannot read /home/mogla/.Qt/5.9.1/Src/qtbase/src/plugins/sqldrivers/qtsqldrivers-config.pri: No such file or directory $ ls /home/mogla/.Qt/5.9.1/Src/qtbase/src/plugins/sqldrivers/ configure.json configure.pri db2 ibase lib mkspecs mysql oci odbc plugins psql qsqldriverbase.pri README sqldrivers.pro sqlite sqlite2 tds $