Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. No MySql driver for QT cross compile Raspberry Pi
Forum Update on Monday, May 27th 2025

No MySql driver for QT cross compile Raspberry Pi

Scheduled Pinned Locked Moved Solved Installation and Deployment
13 Posts 3 Posters 795 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Michael_sa8
    wrote on 20 Jul 2023, 16:12 last edited by
    #1

    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

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 20 Jul 2023, 18:21 last edited by
      #2

      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.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • M Offline
        M Offline
        Michael_sa8
        wrote on 20 Jul 2023, 19:11 last edited by
        #3

        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

        S 1 Reply Last reply 20 Jul 2023, 19:16
        0
        • M Michael_sa8
          20 Jul 2023, 19:11

          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

          S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 20 Jul 2023, 19:16 last edited by
          #4

          @Michael_sa8 where does the sysroot come from ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • M Offline
            M Offline
            Michael_sa8
            wrote on 20 Jul 2023, 19:40 last edited by
            #5

            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
            +++++++++++++++++++++++++++++++++++++++++++++++

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 20 Jul 2023, 19:44 last edited by
              #6

              Then you can install the MariaDB dev package corresponding to their client library and sync again.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • M Offline
                M Offline
                Michael_sa8
                wrote on 20 Jul 2023, 19:52 last edited by
                #7

                actually MariaDB and MySql already installed on RPI. I can create database and tables.

                S 1 Reply Last reply 20 Jul 2023, 19:54
                0
                • M Michael_sa8
                  20 Jul 2023, 19:52

                  actually MariaDB and MySql already installed on RPI. I can create database and tables.

                  S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 20 Jul 2023, 19:54 last edited by
                  #8

                  As written before, you need the development packages in order to build the driver.

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  1
                  • M Offline
                    M Offline
                    Michael_sa8
                    wrote on 20 Jul 2023, 20:03 last edited by
                    #9

                    Is there any tutorial, video or website to check how to do it?

                    S 1 Reply Last reply 20 Jul 2023, 20:12
                    0
                    • M Michael_sa8
                      20 Jul 2023, 20:03

                      Is there any tutorial, video or website to check how to do it?

                      S Offline
                      S Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on 20 Jul 2023, 20:12 last edited by
                      #10

                      @Michael_sa8 do you mean a tutorial on how to use the distribution package manager ?

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      0
                      • M Offline
                        M Offline
                        Michael_sa8
                        wrote on 20 Jul 2023, 20:17 last edited by
                        #11

                        Tutorial on how to use development package in order to build driver for Mariadb and Mysql.

                        jsulmJ 1 Reply Last reply 21 Jul 2023, 05:20
                        0
                        • M Michael_sa8
                          20 Jul 2023, 20:17

                          Tutorial on how to use development package in order to build driver for Mariadb and Mysql.

                          jsulmJ Offline
                          jsulmJ Offline
                          jsulm
                          Lifetime Qt Champion
                          wrote on 21 Jul 2023, 05:20 last edited by jsulm
                          #12

                          @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

                          https://forum.qt.io/topic/113070/qt-code-of-conduct

                          1 Reply Last reply
                          0
                          • M Offline
                            M Offline
                            Michael_sa8
                            wrote on 21 Jul 2023, 18:37 last edited by
                            #13

                            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:

                            https://www.youtube.com/watch?v=8kpHgNKPooc

                            1 Reply Last reply
                            0
                            • M Michael_sa8 has marked this topic as solved on 23 Jul 2023, 20:38

                            1/13

                            20 Jul 2023, 16:12

                            • Login

                            • Login or register to search.
                            1 out of 13
                            • First post
                              1/13
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • Users
                            • Groups
                            • Search
                            • Get Qt Extensions
                            • Unsolved