[Last Call] Learn how to a build a cloud-first strategyRegister Now


config.inc.php file for phpMyAdmin

Posted on 2008-11-19
Medium Priority
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 config.inc.php file and found it at this location:

Applications > MAMP > bin > phpMyAdmin > config.inc.php

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 config.inc.php 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

Umesh earned 1500 total points
ID: 23001340
If your phpmyadmin folder does not have config.inc.php 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


Author Closing Comment

ID: 31518551
Thanks for the solution

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
Recursive SQL is one of the most fascinating and powerful and yet dangerous feature offered in many modern databases today using a Common Table Expression (CTE) first introduced in the ANSI SQL 99 standard. The first implementations of CTE began ap…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses
Course of the Month17 days, 17 hours left to enroll

831 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