How to Install, Setup PhpMyAdmin on Ubuntu 22.04
- 05 Mar, 2025
- Technology
How to Install and Setup phpMyAdmin on Ubuntu 22.04
Install Apache on Ubuntu 22.04
1. Login into your VPS server using putty
2. Change user to root user (If you are not already in root user by using the below command)
sudo - s
3. Update server
sudo apt-get update
4. Upgrade Server
sudo apt-get upgrade
5. Install Apache server
sudo apt install apache2
6. Stop the Apache server
apachectl stop
7. Start Apache server
/etc/init.d/apache2 start
8. Reload Apache server
sudo service apache2 reload
9. Reboot Apache Server
reboot
10. Check Installed Apache Version
apache2 -v
Install phpMyAdmin
1. Install MySQL server
sudo apt install mysql-server
2. Install PHP and its required modules
sudo apt install php libapache2-mod-php php-mysql
3. Install phpMyAdmin and essential PHP extensions
sudo apt install phpmyadmin php-mbstring php-zip php-gd php-json php-curl
4. Select Apache
5. Set the password as - Bako2M1l2m8GHt7KyZa1 (Any complex password)
6. Create a symbolic link for the phpMyAdmin configuration file in Apache’s configuration directory
sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf
7. Enable the phpMyAdmin configuration file in Apache
a2enconf phpmyadmin.conf
systemctl reload apache2
8. Reload the Apache web server
systemctl reload apache2.service
9. Access phpMyAdmin using URL - http://Your-Server-IP/phpmyadmin/
10. Login into MySQL Database
sudo mysql -u root -p
Note: Enter password setup at step 5
11. Create DB
CREATE DATABASE testdb;
12. Create a DB User
CREATE USER 'testusr'@'localhost' IDENTIFIED BY 'ADko2M1l2m8GHt7GyZe3';
13. Assign DB User to DB
GRANT ALL PRIVILEGES ON testdb.* TO 'testusr'@'localhost';