PhpMyAdmin is open source software used primarily for managing MySQL/MariaDB via a browser
[openingText]
If you have MariaDB server installed on your CentOS 7 Linux server, the only way to manage the database is through the Command Line Interface (CLI).
PhpMyAdmin provides an interactive GUI environment that you can use to create databases, tables and even running queries right from a browser Window.
In this guide, we will focus on the steps that you need to follow to install phpMyAdmin on your CentOS 7 server.
[/openingText]
Prerequisites
- [tool]A VPS plan running Centos 7 Server[/tool]
- [tool]A non-root user with sudo privileges[/tool]
- [tool]MySQL server[/tool]
- [tool]Apache web server[/tool]
- [tool]PHP scripting language[/tool]
Step 1: [stepName]First update your system[/stepName]
[step]
[howToDirection]
In order to ensure that we have updated system software and dependencies, we need to run the command below:
$ sudo yum update
[/howToDirection]
[howToDirection]Type Y and hit Enter when prompted to install the updates.[/howToDirection]
This will ensure that our Centos 7 server has the latest security and general package updates
[/step]
Step 2: [stepName]Check Whether MySQL or MariaDB is Working[/stepName]
[step]
[howToDirection]
First, make sure that MySQL/MariaDB server is installed on your system.
Special Note: you can find the best MySQL hosting services here on HostAdvice.
[/howToDirection]
[howToDirection]
You can run any of the commands below:
$ systemctl status mariadb
or
$ systemctl status mysql
[/howToDirection]
[howToDirection]You should see an ‘Active’ status in green if any of the services is running.[/howToDirection]
[howToDirection]
In case you don’t have the database server on your system, you can run the command below to install MariaDB server.
$ sudo yum install mariadb-server mariadb
$ sudo systemctl start mariadb
[/howToDirection]
[howToDirection]
To ensure that our MariaDB server will start at boot, we need to run the command below:
$ sudo systemctl enable mariadb
[/howToDirection]
[howToDirection]
Since a default MariaDB server installation is not secure, we can run the command below to secure it:
$ mysql_secure_installation
This will assist us in setting a root password and remove anonymous users and test databases.
[/howToDirection]
[/step]
Step 3: [stepName]Install phpMyAdmin[/stepName]
[step]
[howToDirection]
Now that we have verified that MySQL/MariaDB server is up and running, we need to install phpMyAdmin. We can do this by running the command below.
$ sudo yum install phpMyAdmin
[/howToDirection]
[howToDirection]Type Y and Enter to confirm the installation[/howToDirection]
[howToDirection]
Next, we need to edit the phpMyAdmin configuration file using a nano editor:
$ sudo nano /etc/httpd/conf.d/phpMyAdmin.conf
[/howToDirection]
[howToDirection]We need to add ‘Require All granted’ value just under the ‘/usr/share/phpMyAdmin/’ directory[/howToDirection]
[howToDirection]
So, the final file excerpt should look like the one below. The change required is highlighted in red:
...
<Directory /usr/share/phpMyAdmin/>
AddDefaultCharset UTF-8
<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAny>
Require ip 127.0.0.1
Require ip ::1
Require all granted
</RequireAny>
</IfModule>
...
</Directory>
[/howToDirection]
[howToDirection]
Restart Apache
$ sudo systemctl restart httpd
[/howToDirection]
[/step]
Step 4: [stepName]Test the installation[/stepName]
[step]
[howToDirection]
You can now visit the address below on your web browser to test the installation
[/howToDirection]
[howToDirection]
If the installation succeeded, you should see the below phpMyAdmin login page. Just enter your username and password and click ‘Go’ to login
[stepImage]
[/howToDirection]
[/step]
Conclusion
That’s all when it comes to installing phpMyAdmin on your Centos 7 server. Remember, you need to log in with your root password if you haven’t added any user on your MariaDB/MySQL database. Once you logged in, you will be able to manage your database and run MySQL queries from an intuitive interface that is far much easier than using the MySQL command line interface.
Check out these top 3 Dedicated server hosting services:
- Want suggestions about Best dedicated servers hosting? Click here and read more.

