Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Unable to build MySQL plugin
QtWS25 Last Chance

Unable to build MySQL plugin

Scheduled Pinned Locked Moved Solved Mobile and Embedded
mysqlandroidsql
16 Posts 7 Posters 7.5k 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 mbnoimi

    Any help guys?

    L Offline
    L Offline
    loogicalrobo
    wrote on last edited by
    #5

    @mbnoimi.. i am suffering in same problem so would you have any idea how to solved that probelm

    M 1 Reply Last reply
    0
    • L loogicalrobo

      @mbnoimi.. i am suffering in same problem so would you have any idea how to solved that probelm

      M Offline
      M Offline
      mbnoimi
      wrote on last edited by
      #6

      @loogicalrobo said in Unable to build MySQL plugin:

      @mbnoimi.. i am suffering in same problem so would you have any idea how to solved that probelm

      Unfortunately I didn't solve it so I created my app using Delphi XE instead of Qt... It seems that Qt gurus don't care much about database (this is general problem in Qt since years ago)

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #7

        Hi,

        There's is officially no native support for MySQL on Android. The fact that MariaDB can be built to be used on that platform is pure luck.

        A better place to get more help with that library would be the MariaDB forums.

        Also note that writing an application that requires direct database access also have security implications. Usually, on mobile platforms, REST services are used to interact with databases.

        @mbnoimi This is a community driven forum, you can't expect the people answering here to have answers for all corner cases which MySQL on Android is one.

        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
        2
        • A Offline
          A Offline
          aykutozdemir
          wrote on last edited by
          #8

          Hello everyone,

          I'm developing cross platform application and i need mysql library for my app. So i successfully compiled it for android too :)

          This is my Bitbucket link: MySQL_Driver_Qt

          Just edit it for your NDK_ROOT, QT_ROOT and other parameters. Don't edit after "Don't edit after this line"

          Call it with "sudo ./build_qt_mysql_driver.sh"

          M 1 Reply Last reply
          2
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #9

            Thanks for sharing !

            Out of curiosity, why sudo ?

            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
            • A aykutozdemir

              Hello everyone,

              I'm developing cross platform application and i need mysql library for my app. So i successfully compiled it for android too :)

              This is my Bitbucket link: MySQL_Driver_Qt

              Just edit it for your NDK_ROOT, QT_ROOT and other parameters. Don't edit after "Don't edit after this line"

              Call it with "sudo ./build_qt_mysql_driver.sh"

              M Offline
              M Offline
              mbnoimi
              wrote on last edited by
              #10

              @aykutozdemir

              thanks a lot for sharing, although I set the right variables but I get the following error:

              mariadb compiled !!!
              
              
              Root privileges is needed for compiling and installing the driver !!!
              
              ~/.Qt/5.8/Src/qtbase/src/plugins/sqldrivers/mysql ~/Desktop/mysql_driver_qt
              make: *** No rule to make target 'clean'.  Stop.
              Project ERROR: Library 'mysql' is not defined.
              make: *** No targets specified and no makefile found.  Stop.
              mbnoimi@mbnoimi-laptop ~/Desktop/mysql_driver_qt $ 
              
              A 1 Reply Last reply
              0
              • M mbnoimi

                @aykutozdemir

                thanks a lot for sharing, although I set the right variables but I get the following error:

                mariadb compiled !!!
                
                
                Root privileges is needed for compiling and installing the driver !!!
                
                ~/.Qt/5.8/Src/qtbase/src/plugins/sqldrivers/mysql ~/Desktop/mysql_driver_qt
                make: *** No rule to make target 'clean'.  Stop.
                Project ERROR: Library 'mysql' is not defined.
                make: *** No targets specified and no makefile found.  Stop.
                mbnoimi@mbnoimi-laptop ~/Desktop/mysql_driver_qt $ 
                
                A Offline
                A Offline
                aykutozdemir
                wrote on last edited by aykutozdemir
                #11

                @mbnoimi

                You are welcome.I updated my script. And i added two QT pro file. Please check my BitBucket repository. In Qt v5.8, there is some errors in mysql.pro file, so you can replace it by my pro file from repository. In the repository, there are two different pro file for android and linux version. Use android_mysql.pro and copy it to ./Qt/5.8/Src/qtbase/src/plugins/sqldrivers/mysql folder and rename as "mysql.pro"
                Maybe you can take backup of original mysql.pro before replacing by my file.

                Then just run my script.

                @SGaist

                You should run this script if your qt sources are under root folder. Mines are under /opt so i have to :) If yours are under /home folder, so you don't need to.

                M 1 Reply Last reply
                1
                • A aykutozdemir

                  @mbnoimi

                  You are welcome.I updated my script. And i added two QT pro file. Please check my BitBucket repository. In Qt v5.8, there is some errors in mysql.pro file, so you can replace it by my pro file from repository. In the repository, there are two different pro file for android and linux version. Use android_mysql.pro and copy it to ./Qt/5.8/Src/qtbase/src/plugins/sqldrivers/mysql folder and rename as "mysql.pro"
                  Maybe you can take backup of original mysql.pro before replacing by my file.

                  Then just run my script.

                  @SGaist

                  You should run this script if your qt sources are under root folder. Mines are under /opt so i have to :) If yours are under /home folder, so you don't need to.

                  M Offline
                  M Offline
                  mbnoimi
                  wrote on last edited by
                  #12

                  @aykutozdemir said in Unable to build MySQL plugin:

                  @mbnoimi

                  You are welcome.I updated my script. And i added two QT pro file. Please check my BitBucket repository. In Qt v5.8, there is some errors in mysql.pro file, so you can replace it by my pro file from repository. In the repository, there are two different pro file for android and linux version. Use android_mysql.pro and copy it to ./Qt/5.8/Src/qtbase/src/plugins/sqldrivers/mysql folder and rename as "mysql.pro"
                  Maybe you can take backup of original mysql.pro before replacing by my file.

                  Then just run my script.

                  Thanks a lot, the script worked like a charm. You can modify it by add the following two lines:

                  # Fix Qt MySQL projects
                  cp $QT_ROOT/Src/qtbase/src/plugins/sqldrivers/mysql/mysql.pro $QT_ROOT/Src/qtbase/src/plugins/sqldrivers/mysql/mysql_orig.pro
                  cp android_mysql.pro $QT_ROOT/Src/qtbase/src/plugins/sqldrivers/mysql/mysql.pro
                  
                  1 Reply Last reply
                  0
                  • A Offline
                    A Offline
                    aykutozdemir
                    wrote on last edited by
                    #13

                    @mbnoimi said in Unable to build MySQL plugin:

                    Fix Qt MySQL projects

                    cp $QT_ROOT/Src/qtbase/src/plugins/sqldrivers/mysql/mysql.pro $QT_ROOT/Src/qtbase/src/plugins/sqldrivers/mysql/mysql_orig.pro
                    cp android_mysql.pro $QT_ROOT/Src/qtbase/src/plugins/sqldrivers/mysql/mysql.pro

                    Thank you for this too, i'm adding these lines to the script.

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      SherSPB
                      wrote on last edited by SherSPB
                      #14

                      @aykutozdemir
                      Hi.ty could not help me to create a MySql plugin for android in qt.You can not create a video instruction about this? If you can already create working compiled MySql plugins under different platforms from 17 and up to now 26? Thanks in advance!

                      1 Reply Last reply
                      0
                      • S Offline
                        S Offline
                        SherSPB
                        wrote on last edited by
                        #15

                        anyone can compile MySql for different platforms from 17 to 26 for Qt 5.8 and publish them as an archive

                        1 Reply Last reply
                        0
                        • A Offline
                          A Offline
                          Allerknappe
                          wrote on last edited by
                          #16

                          can i export this script to windows and use it there?

                          1 Reply Last reply
                          0

                          • Login

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