Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am getting in phpMyAdmin the famous #1045 error: Access denied for user 'root'@'localhost' (using password: YES).

This is my /etc/phpmyadmin/

 * Server(s) configuration
$i = 0;
// The $cfg['Servers'] array starts with $cfg['Servers'][1].  Do not use $cfg['Servers'][0].
// You can disable a server config entry by setting host to ''.

/* Authentication type */
//$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
//$cfg['Servers'][$i]['host'] = 'localhost';
//$cfg['Servers'][$i]['connect_type'] = 'tcp';
//$cfg['Servers'][$i]['compress'] = false;
/* Select mysqli if your server has it */
//$cfg['Servers'][$i]['extension'] = 'mysql';
/* Optional: User for advanced features */
// $cfg['Servers'][$i]['controluser'] = 'pma';
// $cfg['Servers'][$i]['controlpass'] = 'pmapass';
/* Optional: Advanced phpMyAdmin features */
// $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
// $cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark';
// $cfg['Servers'][$i]['relation'] = 'pma_relation';
// $cfg['Servers'][$i]['table_info'] = 'pma_table_info';
// $cfg['Servers'][$i]['table_coords'] = 'pma_table_coords';
// $cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages';
// $cfg['Servers'][$i]['column_info'] = 'pma_column_info';
// $cfg['Servers'][$i]['history'] = 'pma_history';
// $cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';

 * End of servers configuration

 * Directories for saving/loading files from server
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';

Any idea?

share|improve this question

migrated from Jul 19 '10 at 20:48

This question came from our site for professional and enthusiast programmers.

Have you configured your root password for MySQL during installation? Do you have MySQL listening on a unix socket? – sybreon Jul 20 '10 at 2:44
up vote 2 down vote accepted

You realize all the configuration lines are commented out? You need to uncomment and fill-in those fields for anything to happen. I think including this one would be sufficient (assuming you want it to prompt you for a username/password):

$cfg['Servers'][$i]['auth_type'] = 'cookie';
share|improve this answer

execute following command

$ mysqladmin -u root password abcd

and use the password in config file as 'abcd'

or replace your password with 'abcd'

share|improve this answer

Uncomment the below lines and fill the correct info:

$cfg['Servers'][$i]['auth_type'] = 'cookie';

$cfg['Servers'][$i]['host'] = 'localhost';

/* Optional: User for advanced features */ $cfg['Servers'][$i]['controluser'] = 'root'; $cfg['Servers'][$i]['controlpass'] = ''; /*You can leave it blank, PHPmyadmin will ask you the user name and password */

Thats it, if you still facing the problems. I can do this for you.

Thanks & Regards Ramesh Kumar

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.