Search code examples
mysqltermux

How can I install MySQL in termux?


I want to install mysql in android turmux but it is not activating MySQL. It is showing error as

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/data/data/com.termux/files/usr/tmp/mysqld.sock' (2)

I have tried pkill command but didn't work how can I do this.

Thanks in advance!


Solution

  • You can try this:

    Install the maridb package by running below command:

    pkg install mariadb
    

    To access root account, you need to login with Termux user name

    mysql -u $(whoami)
    

    Then try below commands:

    use mysql;
    set password for 'root'@'localhost' = password('YOUR_ROOT_PASSWORD_HERE');
    flush privileges;
    \q
    mysqld_safe
    

    I found the answer Over Here.