Installing phpMyAdmin in CentOS 5.5 on Rackspace Cloud

PhpMyAdmin is a great tool for being able to manage your MySQL database from a GUI. Here is how to install it onto a fresh CentOS 5.5 Server in Rackspace Cloud. PhpMyAdmin requires Apache, PHP, and MySQL to run. This walkthrough will assume a fresh server that has nothing pre-installed. All commands are performed as root

NOTE: This article has become pretty popular in the search engines. This is still an excellent tutorial on installing phpMyAdmin, but there is a slightly easier way to do it by using the EPEL repository. I cover that method in an article at If you have a problem, question, or comment with either of these methods, post a comment and I’ll try to help you out!

Install Apache

First, install apache as described at: but stop before you get to installing PHP.

You will need to modify your /etc/httpd/conf/httpd.conf file beyond that to look for index.php as a Directory Index. Look around line 391 for:

Change this to include index.php like:

Install MySQL

Next up, we need to install MySQL

Now start it up

Now we need to secure it:

It is going to ask you handful of questions:

Current Root Password

You will be asked for your current root password. Because this is a new installation it is set to none. Press enter.

Set Root Password

If the above step worked correctly you should be prompted with a question asking you if you would like to set your root password. Please press Y and press Enter.

You will be asked for your root password twice. If it works you will see Success!

Removing Anonymous Users

You will be prompted to remove the MySQL anonymous users. For security reasons we want to do this. The text above the question explains this topic in more detail. Press Y and then Enter.

Disallow Root Login

You will be asked if you would like to disallow remote login for the root user and only allow connections from the server itself. To keep our server secure you want to say Y and press Enter.

Delete test Database

MySQL ships with a default database called test. This is not needed and can be deleted. Press Y and then Enter to delete the test database and it’s associated users.

Reload Privilege Tables

This step will reload the user settings (called privilege tables) so all user changes will take effect. Press Y and then Enter to continue.

This post won’t go into setting up additional users besides root and assigning them privileges. For information on that, check out the Cloud Servers Knowledge Base:

Install PHP

Now, we need to install php. The problem is that the default yum repos have php 5.1, and the current version of PhpMyAdmin requires 5.2 or higher. To install that version of php, we will need to enable the “testing” repo.

To do that, edit the file /etc/yum.repos.d/CentOS-Base.repo to include this at the bottom:

Great – now we can actually install php

Install PhpMyAdmin

Now finally, we are ready to install PhpMyAdmin! The easiest way to do this is to drop into a new directory called phpmyadmin in the web root of the server. Change directory to the web root:

Now perform a wget to download the latest version. Head over to to see what the latest version is. At the time of this writing, the latest version is 3.3.6. Personally I will download the english tar file with gzip compression. Click the link, cancel the download, and then copy the “Direct link” location that is at the top of the screen. In this case:

So the command is:

Next, we need to untar/unzip it.

Let’s rename the directory to make it easier to remember:

Now, we need to setup the blowfish secret phrase. This is just a random phrase that will be used to encrypt/decrypt data. Let’s make a copy of over to

Now, edit this file at line 18 where it says:

Make it read:

Ok, last but not least, let’s give apache one final restart:

You can now access it by going to either or


The login will be root and whatever you set the root password to be. Now to cleanup, let’s disable the testing repo, just edit the /etc/yum.repos.d/CentOS-Base.repo file to be enabled=0 instead of enabled=1.

Leave a comment ?


  1. Thanks for the guide, it help a lot.

  2. Chris Kenward

    Excellent. Nice and clear – thanks so much.

  3. Works great
    Used this procedure on 3 different machines from remote and installs easily

  4. Zoltan Horvath

    Thank you so much, it worked like a charm.

  5. Thnx U very much , it worked for me on my CnetOS 5.5

  6. This is the first time i work with linux centos and your tutorial helps me great. Keep up the good work!
    Sorry for my bad English.

  7. nice article. thank you so much

  8. thnaks a lot its working fine on my centos Server

  9. PhpMyAdmin thx

  10. thank you so much

    phpmyadmin is working fine i can access however some error encounter at the bottom line

    he [a@./url.php?]mcrypt extension is missing. Please check your PHP configuration.

    i think php-mcrypt is not yet configured or installed,

    i used CentOS 6.0 for my web server, i try to run the command yum install php-mcrypt nothing can get the package, any help? how to enable EPEL for php-mcrypt?

    Thank you,,

  11. this very good tutorial. I have first time work on cloud server. it was gr8

  12. question…just edit the /etc/yum.repos.d/CentOS-Base.repo file to be enabled=0 instead of enabled=1.

    The file is already enabled=0. What should I change?

    I also got this when I log into phpmyadmin.
    Cannot load mcrypt extension. Please check your PHP configuration.

    Any idea?

  13. thanks that’s really help me a lot 😀

  14. thank you! awesome! centos 6.

  15. Great!!!!!!!!!!

    So simple and target

  16. nice guide, thank you it’s help me to setup phpmyadmin on centos. 😀

Leave a Comment

NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

Trackbacks and Pingbacks: