Basically when I try to connect to the mysql database i get this error:
QSqlDatabase: QMYSQL driver not loaded
QSqlDatabase: available drivers: QSQLITE QODBC QOD
Take a look at this post for Qt5, there's also a seperate set of instructions for Qt4 (although somewhat similar).
Qt - How to get|compile Mysql driver
And obviously, when you distribute you'll need to remember to package those DLLs together (always check dependency walker)