Cant connect to mysql using buildozer and kivy

24 Views Asked by At

Using pymysql returns error in Error log. mysql-connector gives similar error. Removing sql from code eliminates the problem and app works fine. Tried with and witouth port in sql connection, firewall is disabled sqlclient on phone works.

mysql connection:

mysql = pymysql.connect(
    host = "192.168.1.10",
    port = 3306,
    user = "user",
    passwd = "pass",
    database = "testdatabase"

error log:

3-08 14:37:53.672 32696 32750 I python  :  Traceback (most recent call last):
03-08 14:37:53.672 32696 32750 I python  :    File "/home/.../.buildozer/android/platform/build-armeabi-v7a_arm64-v8a/build/python-installs/KlimaApp/arm64-v8a/pymysql/connections>
03-08 14:37:53.672 32696 32750 I python  :    File "/home/..../.buildozer/android/platform/build-armeabi-v7a_arm64-v8a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/>
03-08 14:37:53.672 32696 32750 I python  :    File "/home/......./.buildozer/android/platform/build-armeabi-v7a_arm64-v8a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/>
03-08 14:37:53.672 32696 32750 I python  :    File "/home/....p/.buildozer/android/platform/build-armeabi-v7a_arm64-v8a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/>
03-08 14:37:53.672 32696 32750 I python  :  PermissionError: [Errno 1] Operation not permitted
03-08 14:37:53.672 32696 32750 I python  :
03-08 14:37:53.672 32696 32750 I python  :  During handling of the above exception, another exception occurred:
03-08 14:37:53.673 32696 32750 I python  :
03-08 14:37:53.673 32696 32750 I python  :  Traceback (most recent call last):
03-08 14:37:53.673 32696 32750 I python  :    File "/home/mads/Documents/Kivy/klimaapp/.buildozer/android/app/main.py", line 35, in <module>
03-08 14:37:53.673 32696 32750 I python  :    File "/home/mads/Documents/Kivy/klimaapp/.buildozer/android/platform/build-armeabi-v7a_arm64-v8a/build/python-installs/KlimaApp/arm64-v8a/pymysql/connections>
03-08 14:37:53.673 32696 32750 I python  :    File "/home/mads/Documents/Kivy/klimaapp/.buildozer/android/platform/build-armeabi-v7a_arm64-v8a/build/python-installs/KlimaApp/arm64-v8a/pymysql/connections>
03-08 14:37:53.673 32696 32750 I python  :  pymysql.err.OperationalError: (2003, "Can't connect to MySQL server on '192.168.1.67' ([Errno 1] Operation not permitted)")
03-08 14:37:53.673 32696 32750 I python  : Python for android ended.

buildozer.spec:

`


requirements = python3,kivy,pymysql

# (bool) Indicate if the application should be fullscreen or not
fullscreen = 0
android.permission = INTERNET

# (int) Target Android API, should be as high as possible.
android.api = 34


android.archs = armeabi-v7a, arm64-v8a

# (str) python-for-android branch to use, defaults to master
p4a.branch = master


[buildozer]

# (int) Log level (0 = error only, 1 = info, 2 = debug (with command output))
log_level = 2

# (int) Display warning if buildozer is run as root (0 = False, 1 = True)
warn_on_root = 1



0

There are 0 best solutions below