ERROR # 1045 what to do

Problems with the Windows version of XAMPP, questions, comments, and anything related.

ERROR # 1045 what to do

Postby bwayne » 20. August 2010 23:51

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;
bwayne
 
Posts: 3
Joined: 20. August 2010 23:44

Re: ERROR # 1045 what to do

Postby HarryVZ » 22. August 2010 18:40

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
Früher Windows ... jetzt endlich Apple =)
ApacheFriends seit 1997 :-)
HarryVZ
 
Posts: 19
Joined: 13. October 2009 17:20
Location: Österreich
Operating System: OS X

Re: ERROR # 1045 what to do

Postby compuit » 22. September 2011 14:40

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!
compuit
 
Posts: 1
Joined: 22. September 2011 14:33

Re: ERROR # 1045 what to do

Postby JonB » 22. September 2011 14:46

well, did you start MySQL first?
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: ERROR # 1045 what to do

Postby Sharley » 22. September 2011 14:49

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 :)
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 66 guests