December 12, 2018

How to Install phpMyAdmin on CentOS

phpMyAdmin Logo

With phpMyAdmin you can easily handle your MySQL databases through a web interface. This web interface is almost as powerful as the MySQL Command-Line tool. You can execute SQL statements, create, modify and delete databases, tables, fields or rows and manage users or permissions.

Root access is required to edit the following files and to execute commands. Log in as root (su) or simply prepend sudo to all commands that require root privileges.

Install phpMyAdmin

Install phpMyAdmin with YUM. This instruction assumes that you have a MySQL server running. You can install the MySQL server with yum install mysql-server, start it with service mysqld start and set a root password with mysqladmin -u root password PASSWORD.

yum install phpmyadmin

If YUM answers with “No package phpmyadmin” you need to add a new repository. On CentOS 6 the EPEL repository holds the phpMyAdmin package. The following repository is for CentOS 6 with 64 bit. Please replace the repository if necessary.

rpm -Uvh

Run the following command to update all packages. Then you can try to install phpMyAdmin again.

yum update

After you have successfully installed phpMyAdmin open the file phpmyadmin.conf.

vi /etc/httpd/conf.d/phpmyadmin.conf

Then you will see the following lines:

<Directory "/usr/share/phpmyadmin">
  Order Deny,Allow
  Deny from all
  Allow from

Replace from “Allow from″ with your IP or set it to all. Save the file and restart your Apache with:

service httpd restart

Now, you can access phpMyAdmin by opening http://your_IP/phpmyadmin. If you get this error: “The configuration file now needs a secret passphrase (blowfish_secret).” then you need to edit the

vi /usr/share/phpmyadmin/

Find the following line, replace PASSWORD with your password and save the file.

$cfg['blowfish_secret'] = 'PASSWORD';

Now you’re ready to start working with phpMyAdmin.


  1. hit :wq

    to Write and Quit the file (it will save before quitting)

Speak Your Mind