Page 1 of 1

ERROR # 1045 what to do

PostPosted: 20. August 2010 23:51
by bwayne
I recieved this after http://localhost/phpmyadmin/ Where do I check the host, username and password in my configuration

Welcome to phpMyAdmin

Error

MySQL said: Documentation
#1045 - Access denied for user 'root'@'localhost' (using password: NO)
Connection for controluser as defined in your configuration failed.
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 the information given by the administrator of the MySQL server.

<?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'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['AllowNoPassword'] = true;

Re: ERROR # 1045 what to do

PostPosted: 22. August 2010 18:40
by HarryVZ
Hi.
I'm I right you asked for to set host, username and password in config file?
I assume you're using the latest XAMPP for Windows 1.7.3 !!?

The username and password you have already posted here -> so there is where to set a username and password.
What I'm wondering about, you have no hostname posted -> the post does not even contain the whole content of config..

But its quite easy -> just add $cfg['Servers'][$i]['host'] = '[YOUR HOST]'; between auth_type and user.

;-)
best regards

Re: ERROR # 1045 what to do

PostPosted: 22. September 2011 14:40
by compuit
http://localhost/phpmyadmin/

Welcome to phpMyAdmin

Error

MySQL said: Documentation
#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 the information given by the administrator of the MySQL server.


<?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'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['AllowNoPassword'] = true;

/* 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'] = 'mysqli';

/* User for advanced features */
$cfg['Servers'][$i]['controluser'] = 'pma';
$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';

/*
* End of servers configuration
*/

I got asked for a password, typed it in and it stopped working. Please Help!

Re: ERROR # 1045 what to do

PostPosted: 22. September 2011 14:46
by JonB
well, did you start MySQL first?

Re: ERROR # 1045 what to do

PostPosted: 22. September 2011 14:49
by Sharley
Code: Select all
$cfg['Servers'][$i]['auth_type'] = 'config';
Change 'config' to 'cookie' and remove the password you added.

Save the file and restart MySQL.

To test try and access http://localhost/phpmyadmin again by adding root as the user and no password.

If it allows access then to set a password go to http://localhost and select the Security option.

Full instruction in the readme_en.txt file in the xampp folder under the Security heading.

Good luck :)