Nominate our 2022 Qt Champions!

MySql Database Connection, mingw yes, android no

  • Hello everybody,
    i wrote a program to connect to a database (made with xampp mysql) and read some values from it. I got the connection with mingw to my localhost (, but when i want to compile with armeabi-v7 and my android device i get errors:

    W/ (null):0 ((null)): QSqlDatabase: QMYSQL driver not loaded
    W/ (null):0 ((null)): QSqlDatabase: available drivers: QSQLITE
    D/ (null):0 ((null)): "Driver not loaded Driver not loaded"

    What do i have to do?

    I read the article: Build Qt 5 MySQL Plugin for Android, but did not really understand it

  • Lifetime Qt Champion


    As silly as it may sound: follow the wiki article to build the driver. There's no official MySQL client library for Android but this article explains how to build the MariaDB client library for Android so your can build Qt's MySQL driver.

    Note that accessing a database connected directly through internet is a Bad Idea (™). Depending on your needs, a web service providing the info you are needing will be better.

  • ok, but i think it is only written for linux.

    Is there an alternative for connecting a database from the internet to an android device?
    I only need to read out the data (Datetime and Value)

  • Lifetime Qt Champion

    Use a web service for that, there are several frameworks that makes it pretty easy.

Log in to reply