Sign up to our newsletter to receive notifications of extension updates.

Tuesday, 18 January 2011 21:40

How to set up phpMyAdmin for Joomla

Written by 

Joomla is built upon a MySQL database that stores all of the data for the site. This database will contain tables that come predefined with the core installation and others that will have been created by third party extensions. When developing for Joomla it is useful to be able to view the structure of these tables so that you can begin to write code that will add, modify or delete records from them. One way to view the structure is to use phpMyAdmin, which is a "free software tool written in PHP intended to handle the administration of MySQL over the World Wide Web".

This means you can use the phpMyAdmin interface to run SQL queries, make backups of your database stored in a variety of different file formats and import new data from CSV files and the like.

In order to get phpMyAdmin up and running on your Joomla site you need to do the following:

 

 

  • Download phpMyAdmin
  • Upload the phpMyAdmin-3.3.x-english.zip file to your site's main directory via FTP and unzip it there. If your server does not allow this then simply unzip it on your computer and then upload the folder instead. Once it's uploaded, change the name of the folder to "phpMyAdmin".
  • In the phpMyAdmin folder create a file called config.inc.php. There is already a config.sample.php included that should help you with the next part.

  • Enter the following in the config.inc.php file and save it.
    <?php
    // use here a value of your choice (maximum 46 characters):
    $cfg['blowfish_secret'] = 'ANY RANDOM STRING HERE';
    
    $i = 0;
    $i++;
    
    // 'cookie' (or 'http' , especially if mcrypt could not be loaded,
    // but cookie giving more meaningful error messages in the testing phase)
    // older PHP versions had some problems with "cookie" on 64 bit boxes though
    $cfg['Servers'][$i]['auth_type'] = 'cookie';
    
    // PHP 5 support for new MySQL 4.1.3+ features:
    $cfg['Servers'][$i]['extension'] = 'mysqli';
    
    // if you insist on "root" having no password, pma3 needs:
    //$cfg['Servers'][$i]['AllowNoPasswordRoot'] = true;
    ?>
    Remember to add a blowfish_secret of your choice. This can be any random string, up to 46 characters in length.
  • Now go to http://YOURSITE.com/phpMyAdmin.  You will see the login screen for phpMyAdmin.  Enter the username and password for your database, which you can obtain from your configuration.php file in your main Joomla directory.



    So in the configuration file you're looking for code like this:
    $user=USERNAME;
    $password=PASSWORD;
    And you would then use these details here:

  • Finally, you will want to restrict access to http://YOURSITE.com/phpMyAdmin using htaccess. To do this, create two files called .htaccess and .htpsswd in the phpMyAdmin directory.  Go here to generate the content for these files.

Alternatives

There are other ways you could use phpMyAdmin. Your server may have CPanel or something similar installed on it, which usually means you can access phpMyAdmin from there.  There is also JoomMyAdmin, which allows you to run phpMyAdmin as a component in the administrative section of your site.  However, I find that both of these methods are restrictive because they open phpMyAdmin inside frames.  This reduces the size of the interface quite drastically and leads to a diminished user experience.

Read 16728 times Last modified on Wednesday, 19 January 2011 21:19

2 comments

  • Comment Link sevenyearsgone.com Friday, 26 April 2013 06:51 posted by sevenyearsgone.com

    I was initially exploring for suggestions for my website and located your posting, “How to
    set up phpMyAdmin for Joomla”, do you really mind in cases
    where I use some of your tips? Thx -Heriberto

  • Comment Link Sal Saturday, 14 April 2012 12:00 posted by Sal

    Thank you sooo much, been browsing all day long to find out how to access it, the other tutorials weren't clear enough, I wasn't sure where to put the phpmyadmin folder. Thanks again.

Leave a comment

Make sure you enter the (*) required information where indicated.
Basic HTML code is allowed.