PDA

View Full Version : connect MySQL to Qt



borninT
28th March 2018, 21:07
hello guys can someone help me please, i'm trying to connect my database to qt but everytime i compile ther is this ibformation that pop up :
QSqlDatabase: QMYSQL driver not loaded
QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7
Failed to connect to database.

i seached on google but no solutions worked for me can someone please help me, it's an assignment due tomorrow.

d_stranz
28th March 2018, 22:35
You need to find a MySQL DLL / shared library for your platform. Qt supplies only the Qt-side of things; it uses a MySQL run-time library for the other half. The reason your Qt driver won't load is that this MySQL driver isn't present in the same directory as the Qt driver (or reachable on your system PATH).

Maybe next time you should try starting work on your assignments a bit earlier...

borninT
30th March 2018, 10:12
Actually i started earlier but the teacher give us some last changes at the end so... Anyway thank you for your kind advice and the solution that's the only thing that hold me back

d_stranz
30th March 2018, 20:19
but the teacher give us some last changes at the end so...

LOL - Good training for the real world, just change "teacher" to "customer" :D