Issue
I installed Mariadb server / Termux on an Android phone (Huawei) and an Android tablet.
In Termux, Mariadb was launched using:
mysqld_safe -u root &
On the Huawei phone, Mariadb server is accessible only when Termux is currently running in the foreground. After I closed Termux, without terminating, Mariadb is no longer accessible.
On the Android tablet, Mariadb server is accessible even after Termux is closed (without terminating).
I am using flutter to access Mariadb using the driver 'mysql1'.
Is this behaviour specific to a particular version of Android?
Solution
I think your Huawei's android killing background apps. try to ignore termux from battry optimization article about it
use termux service for run mysql termux services docs
Answered By - Noor Mohammed Answer Checked By - Katrina (WPSolving Volunteer)