Install PHPMyAdmin on Android - Dave's Blog

Thursday, December 22, 2022

Install PHPMyAdmin on Android

"Bro, how can i setup my database server with mysql & phpmyadmin? i already installed php server in my device, but i want to add mysql server too for my database, how can i make it?".

Just stay calm, if you already installed php server that's good, but if you don't have php server you can read this page as reference.

After successfully installing php server, you can follow this steps to install mysql server.

1. Upgrade & Update termux application

Like usually, we will update & upgrading our termux application to avoid error that can make mysql server into a problem. Update & Upgrade your termux application with this code:

pkg upgrade && apt update

2. Install MariaDB on your termux

"Why mariadb?, but i want to use mysql server not MariaDB". MariaDB is mysql server, there is no difference between them. Install it by using this code:

pkg install mariadb

Termux

3. Setup your mysql server

After you install it, setup your mysql server. Before you setup your sql server, you must activate your sql server by using this code:

mysqld

Termux

After you activate your sql server, open new section and set a new user for your sql server, like this (for example, we will use user1 and 1234 for password)

mysql

Termux
> CREATE USER 'user1'@'localhost' IDENTIFIED BY '1234';

Then, give user1 a privileges

> GRANT ALL PRIVILEGES ON * . * TO 'user1'@'localhost';

Termux

4. Install PHPMyAdmin

After you finish configuring your sql server, then you must installing phpmyadmin template from PHPMyAdmin official website, and make php server with directory of phpmyadmin like this

php -S localhost:{port} -t {path to phpmyadmin}

Termux

Wait... before you continue, maybe you will get some error like "No such file or directory" in phpmyadmin, right? if you get this error, just open phpmyadmin folder and find config.sample.inc.php, then rename it to config.inc.php. After you do that, open config.inc.php file and find:

$cfg['Servers'][$i]['host'] = 'localhost';

Change localhost to 127.0.0.1

$cfg['Servers'][$i]['host'] = '127.0.0.1';

After that restart your mysql server and run php server in your browser with localhost link, after that input your username and password you setup in your mysql server and click login.

Termux

And... BOOOM. Its working!, that's all from me, if you get any problem just contact me privately at contact us page or in comment column. See you :)

No comments:

Post a Comment