Warning: mysqli_connect(): (HY000/1045): Access denied for user 'username'@'localhost' (using password: YES)

前端 未结 21 2640
春和景丽
春和景丽 2020-11-22 06:31

Warning: mysqli_connect(): (HY000/1045): Access denied for user \'username\'@\'localhost\' (using password: YES) in C:\\Users\\xampp\\htdocs\\PHP_Login_Script

21条回答
  •  春和景丽
    2020-11-22 07:22

    I had this error trying to connect with a different user than root I'd set up to limit access.

    In mysql I'd set up user MofX with host % and it wouldn't connect.

    When I changed the user's host to 127.0.0.1, as in 'MofX'@'127.0.0.1', it worked.

提交回复
热议问题