The first step to setting up phpMyAdmin is to secure it by creating a root password.

Type:
http://localhost/phpmyadmin/ in your browser window.

Go to the privileges tab and click edit privileges for root.

Change the password, retype it and then click go.

Now phpMyAdmin doesn’t work?

After completing the above instructions you will notice that phpMyAdmin does not work anymore. It will
display a message stating:

Error
MySQL said:
#1045 – Access denied for user ‘root’@’localhost’ (using password: NO)
phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to theinformation given by the administrator of the MySQL server.

This is to be expected, and nothing to worry about.

To fix this, you will need to edit the PHPmyAdmin configuration file. This file can be found at:

phpmyadmin/config.inc.php

Open this file in notepad and find the line:

$cfg[‘Servers’][$i][‘auth_type’] = ‘config’;

Change the ‘config’ to ‘cookies’

This is the simplest secure authentication method and will display a simple html form when phpMyAdmin is accessed.

You will now need to add your root password between the ’ ’ in the following line:

$cfg[‘Servers’][$i][‘password’] = ”;

This password should match the password you set in the privileges section of phpMyAdmin.

 

Save the configuration file and phpMyAdmin will be functioning as it should be.