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

前端 未结 20 1497
失恋的感觉
失恋的感觉 2020-11-29 02:41

I installed xampp,but when I tried to run it I got an error as thus:

Error

MySQL said: Documentation

1045 - Access denied for user \'root\'@\'localhost

相关标签:
20条回答
  • 2020-11-29 03:15
    1. Open the config.inc.php file in the WAMP phpmyadmin directory

    2. Change the line ['Servers'][$i]['password'] = '' to

      $cfg['Servers'][$i]['password'] = 'your_mysql_root_password';

    3. Clear browser cookies

    4. Then Restart all services on WAMP

    This worked for me.

    NB: the password to use has to be the MySQL password.....

    0 讨论(0)
  • 2020-11-29 03:19

    If you are using XAMPP rather than WAMP, the path you go to is:

    C:\xampp\phpMyAdmin\config.inc.php
    
    0 讨论(0)
  • 2020-11-29 03:19

    On OSX I had same difficult, but a figure out a solucition

    open terminal

    put 'cd /Applications/XAMPP/xamppfiles'
    put 'sudo ./xampp security'
    

    then put your root password and answer the questions

    0 讨论(0)
  • 2020-11-29 03:20

    My.ini from the file #password and #bind-address="127.0.0.1" are commented change the password to root and uncomment bind-address="127.0.0.1" and from the file cds.php change the

    mysql_connect("localhost", "root", ""); to
    mysql_connect("localhost", "root", "root");
    

    Stop the Mysql services and try login again it got logged in.

    0 讨论(0)
  • 2020-11-29 03:21

    I had this problem with a fresh install of wamp and using only default settings without setting any passwords. I found an incorrect default setting and I solved it by the following steps:

    1. Go to C:\wamp\apps\phpmyadmin4.1.14 (Your phpmyadmin version# may differ)
    2. open the file config.inc in a text editor
    3. find the line: $cfg['Servers'][$i]['host'] = '127.0.0.1';
    4. change it to $cfg['Servers'][$i]['host'] = 'localhost';
    5. save the file
    6. restart all services in wamp

    The problem seems to be that someone forgot to make the server and host match in the configuration files.

    0 讨论(0)
  • 2020-11-29 03:23

    Try this:

    1. Open config.inc.php file in the phpmyadmin directory
    2. Find line 21: $cfg['Servers'][$i]['password'] = '';
    3. Change it to: $cfg['Servers'][$i]['password'] = 'your_password';
    4. Restart XAMPP

    Reference

    0 讨论(0)
提交回复
热议问题