29

When I set the root password in PHPMyAdmin, I get this error:

#1045 - Access denied for user 'root'@'localhost' (using password: NO)

I can't open the PHPMyAdmin panel. What am I doing wrong?

7
  • 1
    -1 What is your question? What do you mean by your numbered list of steps? Commented Jul 14, 2012 at 10:28
  • Did you (by mistake) put [COLOR="rgb(255, 140, 0)"] in the file too? Commented Jul 14, 2012 at 10:29
  • @EmilVikström: NB: I wrote all this explications, because I'm also learning PHP and I found a lot on this website helped me, so I'm trying also to help you. But again the same problem Commented Jul 14, 2012 at 10:30
  • Use password root and try may be work beacuse mysql default user name and password is root Commented Jul 14, 2012 at 10:31
  • @EmilVikström answers found from the problem from other website post...but this not solved my problem Commented Jul 14, 2012 at 10:31

2 Answers 2

85

Edit your phpmyadmin config.inc.php file and if you have Password, insert that in front of Password in following code:

$cfg['Servers'][$i]['verbose'] = 'localhost';
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['port'] = '3306';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = '**your-root-username**';
$cfg['Servers'][$i]['password'] = '**root-password**';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
Sign up to request clarification or add additional context in comments.

4 Comments

Rejected Edit: i got the same error when i install xampp on my windwos7 system. solution i found is: in config.inc.php file i replaced the $cfg['Servers'][$i]['auth_type'] = 'config'; to $cfg['Servers'][$i]['auth_type'] = 'cookie'; then everything working fine... test your luck if have same issue...
I am having this problem on my production server... I am using filezilla, Can you please tell me where can I get this config.inc.php in that running server files ? any help will be appreciated. Thank you.
In wamp , for those who are finding hard to get config.inc file ,it is present in \wamp\apps\phpmyadmin\ folder.
Why is phpmyadmin not doing this for us??! (PS: On Linux Lampp the folder is in lampp/phpmyadmin/config.inc.php
2

Here are few steps that must be followed carefully

  1. First of all make sure that the WAMP server is running if it is not running, start the server.
  2. Enter the URL http://localhost/phpmyadmin/setup in address bar of your browser.
  3. Create a folder named config inside C:\wamp\apps\phpmyadmin, the folder inside apps may have different name like phpmyadmin3.2.0.1

  4. Return to your browser in phpmyadmin setup tab, and click New server.New server

  5. Change the authentication type to ‘cookie’ and leave the username and password field empty but if you change the authentication type to ‘config’ enter the password for username root.

  6. Click save save

  7. Again click save in configuration file option.
  8. Now navigate to the config folder. Inside the folder there will be a file named config.inc.php. Copy the file and paste it out of the folder (if the file with same name is already there then override it) and finally delete the folder.
  9. Now you are done. Try to connect the mysql server again and this time you won’t get any error. --credits Bibek Subedi

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.