smftr
smftr

Reputation: 955

Connection for controluser as defined in your configuration failed. #1045 Cannot log in to the MySQL server

I have xampp installed in my windows. before, i can login to my phpmyadmin easily with my username and password. After long time, i cannot login to phpmyadmin with following messages:

#1045 Cannot log in to the MySQL server 
Connection for controluser as defined in your configuration failed.

i believe my password is true (from config.inc.php)

this is config.inc.php

<?php
/*
 * This is needed for cookie based authentication to encrypt password in
 * cookie
 */
$cfg['blowfish_secret'] = 'xampp'; /* YOU SHOULD CHANGE THIS FOR A MORE SECURE COOKIE AUTH! */

/*
 * Servers configuration
 */
$i = 0;

/*
 * First server
 */
$i++;

/* Authentication type and info */
$cfg['Servers'][$i]['auth_type']     = 'cookie';      // Authentication method (config, http or cookie based)
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['password'] ='1234';
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Lang'] = '';

/* Bind to the localhost ipv4 address and tcp */
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['connect_type'] = 'tcp';

/* User for advanced features */
$cfg['Servers'][$i]['controluser'] = 'root';
$cfg['Servers'][$i]['controlpass'] = '';

/* 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';
$cfg['Servers'][$i]['tracking'] = 'pma_tracking';
$cfg['Servers'][$i]['userconfig'] = 'pma_userconfig';
$cfg['Servers'][$i]['recent'] = 'pma_recent';
$cfg['Servers'][$i]['table_uiprefs'] = 'pma_table_uiprefs';

/*
 * End of servers configuration
 */

?>

Upvotes: 1

Views: 8155

Answers (1)

Isaac Bennetch
Isaac Bennetch

Reputation: 12442

According to the config.inc.php you've posted, your root user password is 1234 (as I see in the line $cfg['Servers'][$i]['password'] ='1234';), but later in the file when you're defining the controluser, you use a blank password.

I suggest setting up an actual controluser with fewer permissions than root has, but the quick fix would be to edit and make this change: $cfg['Servers'][$i]['controlpass'] = '1234';

To create a controluser account, use an SQL command similar to this:

GRANT SELECT, INSERT, UPDATE, DELETE ON <pma_db>.* TO 'pma'@'localhost' IDENTIFIED BY 'pmapass';

substituting the name of your phpMyAdmin configuration storage database (probably 'phpmyadmin') for <pma_db> and a custom password for pmapass.

Upvotes: 4

Related Questions