Cloud Service >> Knowledgebase >> General >> 8 Simple Steps to Install phpMyAdmin on CentOS 7
submit query

Cut Hosting Costs! Submit Query Today!

8 Simple Steps to Install phpMyAdmin on CentOS 7

phpMyAdmin is a popular but open-source web-based tool that beefs up the administration of MySQL and MariaDB databases with a user-friendly interface. It makes it possible to accomplish complicated things like designing, configuring, and maintenance of databases, tables, users, and data, with the utilization of simple, few commands. If phpMyAdmin will be used for pipe-dreaming, CentOS 7 server or administration, and you need to handle your MySQL or MariaDB databases, installing the phpMyAdmin will greatly improve productivity and make administration easier. Referring to the 8 easy-to-follow steps provided here, you can set up phpMyAdmin on your CentOS 7 server.

Step 1: Update the System Packages

Before installing the system, you always have to check if the installed system packages, as well as the versions of the packages, are up to date. Use this command to make your package manager contact the repository host for the latest repository data.

sudo yum update

Step 2: Install the LAMP Stack

phpMyAdmin is an application that must refer to a single web server, a PHP, and a MySQL or MariaDB database server to work correctly and efficiently. For CentOS 7 installation, you can go for the LAMP stack (Linux, Apache, MySQL/MariaDB, PHP) using one command.

sudo yum install httpd mariadb-server php php-mbstring php-xml -y

With this command, you will have the Apache web server, MariaDB (the open-source MySQL from the community), and PHP with all modules required for phpMyAdmin installed on your system.

Step 3: Start and Enable the Required Services

Hap Apache web server and experience Enable it to need and after start and sessions system to make sure it automatic at startup.

sudo systemctl start httpd

sudo systemctl start mariadb

sudo systemctl enable httpd

sudo systemctl enable mariadb

Step 4: Secure the MariaDB Installation

To enhance security, you must execute the security operation script, prompting you to set a password for the root user, renounce the anonymous user, disable remote root login, and remove test databases.

sudo mysql_secure_installation

Respond to each prompt and beyond your preferences choose which option you would consider making.

Step 5: Download and Extract phpMyAdmin

Navigate to the official phpMyAdmin downloads page (https://www.phpmyadmin.net/downloads) //write the way to the latest version's compressed file link (.tar.gz or .zip). Then, enter the wget command and specify the path on your CentOS 7 server you would like to save the file.

Wget https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages.tar.gz

Extract the retrieved file using the following instructions:

tar -xvzf phpMyAdmin-latest-all-languages.tar.gz

Step 6: Move the phpMyAdmin Files to the Apache Web Server Directory

Transfer the depth of phpMyAdmin directory to the Apache web server document folder where the files are stored:

sudo mv phpMyAdmin-latest-all-languages /var/www/html/phpmyadmin

Step 7: Configure Apache for phpMyAdmin

Go ahead and execute an Apache configuration file creation by using your favorite text editor (e.g. nano, vim):

sudo nano /etc/httpd/conf.d/phpmyadmin.conf

Amend the file inside the folder by including the following lines:

Alias /phpmyadmin /var/www/html/phpmyadmin

    AddDefaultCharset UTF-8

    

        Require all granted

    



    

        Require all denied

    



    

        Require all denied

    



Click the 'Save' button and then leave the text editor.

Step 8: Restart the Apache Web Server

Finally do on/off the Apache for phpMyAdmin then reload the Apache web server service to initialize the changes.

sudo systemctl restart httpd

You can now access the phpMyAdmin interface by navigating to http://your_server_ip/phpmyadmin or http://your_domain_name/phpmyadmin - replace your_server_ip with the IP address of your server and your_domain_name with the name of your domain. For the first step, you will be guided to feed in the MariaDB root user's password which you generated previously (Step 4: secure installation).

Congratulations! With the installation on your CentOS 7 server of phpMyAdmin, you have completed the process. With this web-based interface, you can now use it for administering all the MySQL or MariaDB databases on the Internet quickly by using a web browser.

Additional Tips and Considerations:

  1. Secure phpMyAdmin: To raise the safety level of your phpMyAdmin setup, you might want to include TLS and HTTP authentication as well as create a dedicated phpMyAdmin user account.

  2. Update phpMyAdmin Regularly: The phpMyAdmin software's release cycle is ongoing, which involves fixing holes and incorporating new features in response to any security challenges or user requests. Maintain the timeliness of your installation by checking your version to identify if there exist new releases, and follow them accordingly.

  3. Enable SSL/TLS: Moreover, to improve the security quality, you can procure SSL/TLS encryption for your phpMyAdmin instance by telling Apache how to use HTTPS instead of HTTP. This will encrypt the communication between your web browser and the server web browser and the server, hence providing a supplemented layer of protection.

  4. Limit Access: You will depend on the way you will set it up; but if you want to limit the access of phpMyAdmin by IP or network address, you will have to do that. This is accomplished by editing the Apache’s configuration file to put access control directives.

  5. Backup Databases: Before you modify any databases will any serious using phpMyAdmin, it is always with formatting a backup copy. We cannot forget phpMyAdmin because it has a very convenient way of both exporting and importing the database. But you can continue using command line tools as well like mysqldump for example to save the necessary information.

In this way, you have carefully installed the latest phpMyAdmin software on an operating system CentOS 7 to visualize your MySQL and MariaDB databases as graph-plots.

Cut Hosting Costs! Submit Query Today!

Grow With Us

Let’s talk about the future, and make it happen!