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

前端 未结 23 3402
刺人心
刺人心 2020-11-30 01:39

This might seem redundant but I was unable to find a correct solution.

I was unable to login to mysql using the mysql console.It is asking for a password and I have

相关标签:
23条回答
  • 2020-11-30 02:40

    I have encountered similar mistakes, and later found that my password is wrong.

    0 讨论(0)
  • 2020-11-30 02:41

    after installation i started wamp and i was asked for user and pass which were already set on default (user:admin pass: dots), and that was wrong with a message from your topic. Than, i just entered:

    Username: root 
    Password: (leave it empty)
    

    and it worked for me!!

    0 讨论(0)
  • 2020-11-30 02:42

    I first changed the root password running mysql at a prompt with

    mysql -u root -p
    

    Update password:

    UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';
    

    Edited line in the file config.inc.php with the new root password:

    $cfg['Servers'][$i]['password'] = 'MyNewPass'
    

    Stop and re-start mysql service (in Windows: mysql_stop.bat/mysql_start.bat)

    and got phpMyAdmin to work!

    EDIT 2017: for MySQL≥5.7 use authentication_string in place of Password (see this answer):

    UPDATE mysql.user SET authentication_string=PASSWORD('MyNewPass') WHERE User='root';

    0 讨论(0)
  • 2020-11-30 02:43
    1. Go to C:\xampp\phpMyAdmin

    2. Edit the config.inc.php file

    3. Replace $cfg['Servers'][$i]['auth_type'] = 'config'; by $cfg['Servers'][$i]['auth_type'] = 'cookie';

    For now on the PHPMyAdmin will ask you for your password, no more error.

    0 讨论(0)
  • 2020-11-30 02:44

    In the my.ini file in C:\xampp\mysql\bin, add the following line after the [mysqld] command under #Mysql Server:

    skip-grant-tables
    

    This should remove the error 1045.

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