Important: Please read the Qt Code of Conduct -

MySQL driver

  • I'm using Ubuntu. I installed Qt 5.1.1 using .run file and I couldn't connect to a mysql database (even though QSqlDatabase::drivers() showed it as available). I found out that I needed to recompile the mysql driver. And to do that I installed a package qmake 4.8.1. I couldn't compile the driver, I figured it's because of the version difference.

    Now I'm thinking it would be easier for me to just install Qt 4.8 instead but I'm not sure how to do that. There are Qt 4.8.1 libraries on the website, but I'm not sure what am I supposed to do with them. Should I compile them and get an IDE and connect them somehow or something? It's really frustrating, I've been trying to connect to mysql for days.

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    You have to use the qmake coming with your 5.1.1 install.

    If drivers)= shows the QMySql driver it means the plugin's there. If it can't be loaded it probably means that you are missing some libraries on your system. Use ldd on the plugin to see whether there are missing dependencies and just install them. Then you should be good to go.

Log in to reply