Skip to content

Instantly share code, notes, and snippets.

@ricardojlrufino
Last active June 11, 2024 11:37
Show Gist options
  • Save ricardojlrufino/93c62751c3bf8541a04f173d2fac0017 to your computer and use it in GitHub Desktop.
Save ricardojlrufino/93c62751c3bf8541a04f173d2fac0017 to your computer and use it in GitHub Desktop.
MariaDB/MSQL on Termux

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;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment