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

前端 未结 21 2197
春和景丽
春和景丽 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:12

    This is your code:

    
    

    The only error that causes this message is that:

    1. you're defining a DB_USER but you're calling after as DB_USERNAME.

    Please be more careful next time.

    It is better for an entry-level programmer that wants to start coding in PHP not to use what he or she does not know very well.

    ONLY as advice, please try to use (for the first time) code more ubiquitous.

    ex: do not use the define() statement, try to use variables declaration as $db_user = 'root';

    Have a nice experience :)

提交回复
热议问题