phpMyAdmin is a web-based GUI tool to manage your MySQL and MariaDB Databases. It is an Open-source and free tool. Following are the steps to install phpMyAdmin on Centos 7.
- We will install EPEL repository first because cPanel doesn't have access to phpMyAdmin within its software repository By Default.
#sudo yum install -y epel-release
- Install the Apache server with the below command.
# sudo yum install httpd -y
- Start the Apache Server.
# systemctl start httpd
- Install phpMyAdmin with below command.
# sudo yum -y install phpmyadmin
- Let's modify the phpMyAdmin config file to allow only specific IP Addresses. This file should be created automatically while installing phpMyAdmin.
- Open phpMyAdmin.conf file.
# sudo nano /etc/httpd/conf.d/phpMyAdmin.conf
- Start the Apache Server.
# systemctl start httpd
- Edit the Require ip 127.0.0.1 with your local connection IP Address. There might be four-place were in the same file where you need to set your IP address in place of 127.0.0.1. Click here to view your Ip Address.
- Save and Close the phpMyAdmin.conf
- Restart the Apache.
- Open the phpMyAdmin in your browser with the serverip/phpmyadmin.
- You can locate the phpMyAdmin Username and Password from config.inc.php located at /etc/phpMyAdmin
- Open it with the vi editor.
$cfg['Servers'][$i]['auth_type'] = 'cookie'; )? $cfg['Servers'][$i]['user'] = 'username'; $cfg['Servers'][$i]['password'] = 'password'; $cfg['Servers'][$i]['only_db'] = '';
- Save this file with :wq
Now, you can log in to your phpMyAdmin using the same credentials.