Install PHPMyAdmin on Centos


Setting up PHPMyAdmin on Centos using the EPEL software repository


Explanation of requirements.

  1. Root or Sudo access with root privileges.
  2. Working httpd (Apache) configuration.
  3. Working MySQL or MariaDB configuration.

Doing the Work

Basic description of what will be done and what is expected.

  1. Setup EPEL:
  2. su -c ""

  3. Install phpMyAdmin:
  4. sudo yum install phpMyAdmin
    After the install, you can use: rpm -ql phpMyAdmin to see a list of files and their locations installed during the installation process.

  5. Setup subdomain for your site to access phpMyAdmin:
  6. For this example we’re going to create a virtual host subdomain as:

    We’re using “phpadmin instead of phpMyAdmin to make it easier to type, you can replace “phpadmin” with anything you like and add an SSL certificate for added security.

    1. We’ll need to edit the httpd configuration or edit /etc/httpd/conf.d/phpMyAdmin.conf to add the subdomain in the virtual hosts section at the bottom as follows:
    2. vi /etc/httpd/conf.d/vhosts.conf (this assumes you already have setup and working)

    3. Symlink the phpMyAdmin files to: /var/www/html/phpadmin or use /etc/httpd/conf.d/phpMyAdmin.conf
    4. (note: make sure /var/www/html/phpadmin does not exist before running the symlink command)

      sudo ln -s /usr/share/phpMyAdmin /var/www/html/phpMyAdmin

    5. Restart httpd
    6. C6: service httpd restart
      C7: systemctl restart httpd.service

Troubleshooting & Testing

Explanation troubleshooting basics and expectations.

  1. Let’s go test and make sure we can login:
  2. Open a web browser and navigate to:

  3. Make sure httpd and (mysql | mysqld | mariadb) are started, also make sure you have a working MySQL or MariaDB configuration:
  4. C6: service mysqld status; sudo service httpd status
    C7: systemctl status mariadb.service; systemctl status httpd.service

Last Modified: 21 Apr, 2020 at 10:46:49