Cannot find mysql drivers
-
Hello
I am struggling with the mysql driver for android.
I successfully installed the mysql driver for my pc and on the qt creator the app connects to my database without any problem.
But when I tried to put my app on the phone, i got errors, and then, I printed the available drivers for QSqlDatabase into qDebug while lauching on the phone and there showed only the QSqlite driver.
I tried installing it but I don't know exactly what am I looking for.
If you can help me, i would be grateful.
-
Hi and welcome to devnet,
There's no prebuilt MySQL for Androïd. If you really want that you'll have to first build the MariaDB client library for Androïd and then the MariaDB driver.
That said, when people try to access a MySQL database directly like that from Androïd, it means they are planning to expose their server directly on internet which is a very bad idea. The recommendation is to have a REST api in front of the database that will return only required data and also abstract the database itself.