6 C
Texas
angeloma
Senior Writer and partner

How to install the latest PhpMyAdmin on CentOS 7?

In terms of practicality, managing MySQL data on a console is not recommended. Overotodo if you handle a lot of records and tables. For this, there are many professional solutions that can get us out of the problem, however, if the project is personal or is something small, you can use PhpMyAdmin. A solution well known in Linux and that fulfills its objective in an efficient and simple way. With this in mind, I will teach you how to install the latest PhpMyAdmin on a server using CentOS 7.

PhpMyAdmin is an open source tool created with PHP to visualize and manage the data of a MySQL server in a graphical way. It has the support of a large community behind it and you can perform multiple operations on MySQL such as executing sentences, importing or exporting databases. Among other things.

So, let us start.

1. Install Apache web server and PHP

Being a web tool, the first thing we have to do is install the Apache web server. PhpMyAdmin also works with Ngnix quite efficiently. However, Apache is the easiest to use and works just as well.

- Advertisement -

So, open a terminal and run:

:~$ su
:~# yum install httpd

1.- Install apache
1.- Install apache

After that, it is necessary to install PHP. Obviously, PHP is available in the official CentOS 7 repositories, the problem is that it is a very old version and PhpMyAdmin requires at least PHP 7.1. Then, you need to install a recent version of PHP.

You can install PHP 7.2 on CentOS 7 easily using the steps shown in this post.

Then, you need to install the PHP modules to work with PhpMyAdmin.

:~# yum install php php-session php-json php-hash php-ctype php-mbstring php-zip php-gd php-curl php-openssl php-xml

2.- Install PHP
2.- Install PHP

Next, enable and start the Apache service.

:~# systemctl enable httpd
:~# systemctl start httpd

Then, enable Apache on the Firewall to allow access.

:~# firewall-cmd --add-service=http --permanent
:~# firewall-cmd --reload

3.- Firewall settings
3.- Firewall settings

To test if PHP is working, create a file called test.php on /var/www/html/ with this content:

:~# yum install nano
:~# nano /var/www/html/test.php
<?php
phpinfo();
?>

4.- PHP info
4.- PHP info

So, open your web browser and go to http://SERVER_IP/test.php.

5.- PHP and apache are working
5.- PHP and Apache are working

So, Apache and PHP are working.

2. Install and configure MariaDB

The next step is to install MariaDB from the repositories. So it is pretty easy to do.

:~# yum install mariadb-server

6.- Install MariaDB
6.- Install MariaDB

After that, enable and start it.

:~# systemctl enable mariadb
:~# systemctl start mariadb

7.- Start mariadb
7.- Start MariaDB

Next, configure MariaDB using the mysql_secure_installation script to set a root password.

:~# mysql_secure_installation

8.- Using mysql_secure_installation
8.- Using mysql_secure_installation

You can answer the questions that come up as you like. However, I recommend that you read them properly to establish the best configuration for your server. In this case, I will respond as follows: Y, N, Y, Y.

3. Install PhpMyAdmin

At the time of writing this post, the latest stable version of PhpMyAdmin is 4.8.5 the easiest way to install it is through the REMI repository.

So, install it.

:~# yum --enablerepo=remi install phpmyadmin

9.- Install the latest PhpMyAdmin
9.- Install the latest PhpMyAdmin

After that, open the PhpMyAdmin configuration file for apache to allow the connections to it.

:~# nano /etc/httpd/conf.d/phpMyAdmin.conf

In the IfModule mod_authz_core.c section, add

Require all granted.

 

10.- Edit the phpmyadmin configuration file for apache
10.- Edit the phpmyadmin configuration file for apache

Next, restart Apache.

:~#  systemctl restart httpd

After that, open your web browser and go to http://SERVER_IP/phpmyadmin

11.- PHPMyAdmin
11.- PHPMyAdmin

Log in with your user and enjoy!

12.- PhpMyAdmin start screen
12.- PhpMyAdmin start screen

That’s it.

Conclusion

PhpMyAdmin is a very useful tool to manage MySQL data in a very simple way. It is free, open source and perfectly compatible with your web servers.

Please share this article in your social networks.

 

- Advertisement -
Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"

1 COMMENT

LEAVE A REPLY

Please enter your comment!
Please enter your name here



Latest article