Unable to build MySQL plugin
-
@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)
-
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.
-
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"
-
Thanks for sharing !
Out of curiosity, why
sudo
? -
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 $
-
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.
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.
-
@aykutozdemir said in Unable to build MySQL plugin:
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
-
@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.proThank you for this too, i'm adding these lines to the script.
-
@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! -
can i export this script to windows and use it there?