ERROR 1698 (28000): Access denied for user 'root'@'localhost'

后端 未结 17 1565
执笔经年
执笔经年 2020-11-22 10:00

I\'m setting up a new server and keep running into this problem.

When I try to login to the MySQL database with the root user, I get the error:

17条回答
  •  孤街浪徒
    2020-11-22 10:48

    After hours of struggle with no solution here, this worked for me then I found a youtube video where it says the password column is now called authentication_string . So I was able to change my password as follows: First get into mysql from terminal

    sudo mysql
    

    then inside mysql type whatever after mysql>

    mysql> use mysql
    mysql> update user set authentication_string=PASSWORD("mypass") where user='root';
    mysql> flush privileges;
    mysql> quit;
    

    at this point you are out of mysql back to your normal terminal place. You need to restart mysql for this to take effect. for that type the following:

    sudo service mysql restart
    

    Refer to this video link for better understanding

提交回复
热议问题