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

前端 未结 23 3435
刺人心
刺人心 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: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';

提交回复
热议问题