Follow this.: https://wiki.termux.com/wiki/MariaDB
If don't works, try:
killall mariadbd
rm -rf $PREFIX/var/lib/mysql/*
mysql_install_db --user=root --auth-root-authentication-method=normal --datadir=${PREFIX}/var/lib/mysql
mysqld_safe -u root &
Change password
mysql -u root
use mysql;
set password for 'root'@'localhost' = password('YOUR_ROOT_PASSWORD_HERE');
flush privileges;
quit;
Allow remote access
CREATE USER 'root'@'%' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;