Error # 1045 - Cannot Log in to MySQL server -> phpmyadmin

前端 未结 10 2643
别跟我提以往
别跟我提以往 2021-01-01 23:28

We have installed PHPMyAdmin on a windows machine running IIS 7.0.
We are able to connect to MySQL using command-line, But we are not able to connect using PHPMyAdmin.

10条回答
  •  遥遥无期
    2021-01-02 00:08

    In mysql 5.7 the auth mechanism changed, documentation can be found in the official manual here.

    Using the system root user (or sudo) you can connect to the mysql database with the mysql 'root' user via CLI. All other users will work, too.

    In phpmyadmin however, all mysql users will work, but not the mysql 'root' user.

    This comes from here:

    $ mysql -Ne "select Host,User,plugin from mysql.user where user='root';"
    +-----------+------+-----------------------+
    | localhost | root | auth_socket |
    |  hostname | root | mysql_native_password |
    +-----------+------+-----------------------+
    

    To 'fix' this security feature, do:

    mysql -Ne "update mysql.user set plugin='mysql_native_password' where User='root' and Host='localhost'; flush privileges;"
    

    More on this can also be found here in the manual.

提交回复
热议问题