Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connecting to MariaDB Server on Termux Android

I'm working on launching a NodeJS project directly on a local database on an Android Device and for this I use Termux and MariaDB Server.

It perfectly works after using the commands

mysqld & 

and

node mynodefile.js

on Termux. But I would like to avoid the "mysqld &" command and launch the MariaDB Server in another way. So I downloaded the MariaDB Server App for Android. But even if I launch the server with it, Termux doesn't even detect the new process and I can't access to mysql. It gives me the following error:

$ mysql -u root -p -h127.0.0.1
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/data/data/com.termux/files/usr/var/lib/mysqld.sock' (111)

It seems that the server is still off... How can I resolve my problem?

like image 957
DeenOub Avatar asked Oct 31 '25 00:10

DeenOub


1 Answers

try

$mysql_install_db

$mysqld

then

$mysql -u root -p
like image 161
Bola Ibrahim Avatar answered Nov 01 '25 15:11

Bola Ibrahim