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

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

    Look at your code You defined DB_HOST and querying DB_SERVER. DB_USER and DB_USERNAME Use this code

    define("DB_SERVER", "localhost");
    define("DB_USER", "root");
    define("DB_PASSWORD", "");
    define("DB_DATABASE", "databasename");
    
    $connect = mysqli_connect(DB_SERVER , DB_USER, DB_PASSWORD, DB_DATABASE);
    

提交回复
热议问题