Solved file for phpMyAdmin

Posted on 2008-11-19
Last Modified: 2013-12-13
Hi everyone,

I'm working my way through a book in order to try and set up a php/apache/mysql testing environment on my mac computer. I've downloaded MAMP to get it going (even though the book uses separate php mysql etc components, as opposed to MAMP).

The book is saying that phpMyAdmin uses a text file to store all the configuration
details and that since version 2.7.0, you no longer edit the phpMyAdmin configuration file
but store your personal details in a new file, which should be named

After I installed MAMP I did a search on my computer for the file and found it at this location:

Applications > MAMP > bin > phpMyAdmin >

When I opened this file, I noticed that it has over 700 lines of code and information. I'm a bit confused because the book provides instructions on how to create this file manually. It says to type the following code into a blank document:

$i = 1;
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['password'] = 'mysqlRootPassword';

Then to save the file as in the main phpMyAdmin folder. I don't understand why I have to create this new config file with just that bit of code when this file already exists but with a whole lot more code and information.

Can someone explain how this works?

Question by:gwh2
    LVL 26

    Accepted Solution

    If your phpmyadmin folder does not have file then just create it(no need to create if it already exists).

    And make sure you set these settings properly ( // at the end)

    $cfg['Servers'][$i]['auth_type'] = ''; -- dictates the authentication method used when connecting to your phpMyAdmin installation.

        The three options for authentication are:

            * config (the default method)
            * http
            * cookie (recommended method)

        config method - This method is the least secure, as it requires storing your MySQL username and password in the file on the server. Anyone who would find the directory to your phpMyadmin installation would then be able to access your databases. This is the default method, however. *See important note.

        http or cookie authentication methods - These methods are more secure, as your username and password are not stored on the server in your configuration file.

    /* Servers configuration */
    $i = 0;
    $cfg['Servers'][$i]['host'] = 'localhost'; //
    $cfg['Servers'][$i]['extension'] = 'mysqli';
    $cfg['Servers'][$i]['port'] = '3306'; //
    $cfg['Servers'][$i]['connect_type'] = 'tcp';
    $cfg['Servers'][$i]['auth_type'] = 'config'; // 
    $cfg['Servers'][$i]['user'] = 'root'; //
    $cfg['Servers'][$i]['password'] = 'your password'; //

    Open in new window

    LVL 1

    Author Closing Comment

    Thanks for the solution

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    PRTG Network Monitor: Intuitive Network Monitoring

    Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

    Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
    Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
    Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
    The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now