No MySql driver for QT cross compile Raspberry Pi
-
I managed to configure QT6 cross compile with Raspberry Pi. Everything work fine but when I want to connect to MySql database I received below error:
+++++++++++++++++++++++++++++++++++++++++++++++++
QSqlDatabase: QMYSQL driver not loaded
QSqlDatabase: available drivers: QPSQL QSQLITE QIBASE++++++++++++++++++++++++++++++++++++++++++++++++++
Anyone knows how to solve this issue.By the way I read this website https://doc.qt.io/qt-6/sql-driver.html unfortunately, it is not usable for this problem.
Thanks
-
Hi,
Do you have client libraires for MySQL for arm in your sysroot ? If not, that's the main issue. From memory there are no MySQL package for that platform however, you can use the MariaDB connector library which should be available or at least buildable for it.
-
Thanks for your reply.
I checked rpi sysroot on my host machine(Ubuntu). I just found mysql folder with a client.pyi inside. Could you please help to build the library?
Thanks -
@Michael_sa8 where does the sysroot come from ?
-
from here:
+++++++++++++++++++++++++++++++++++++++++++++++
rsync -avz --rsync-path="sudo rsync" pi@x.x.x.x:/usr/include rpi-sysroot/usr
rsync -avz --rsync-path="sudo rsync" pi@x.x.x.x:/lib rpi-sysroot
rsync -avz --rsync-path="sudo rsync" pi@x.x.x.x:/usr/lib rpi-sysroot/usr
rsync -avz --rsync-path="sudo rsync" pi@x.x.x.x:/opt/vc rpi-sysroot/opt
+++++++++++++++++++++++++++++++++++++++++++++++ -
Then you can install the MariaDB dev package corresponding to their client library and sync again.
-
actually MariaDB and MySql already installed on RPI. I can create database and tables.
-
As written before, you need the development packages in order to build the driver.
-
Is there any tutorial, video or website to check how to do it?
-
@Michael_sa8 do you mean a tutorial on how to use the distribution package manager ?
-
Tutorial on how to use development package in order to build driver for Mariadb and Mysql.
-
@Michael_sa8 said in No MySql driver for QT cross compile Raspberry Pi:
how to use development package
Install those packages like any other packages.
Also see https://doc.qt.io/qt-6/sql-driver.html#qmysql -
Unfortunately, this document wont work. I discussed with another guy on youtube and we found the solution. Here is the link for installation and you can find MYSql solution in comment below of video:
-