PHP cant connect to MySQL

前端 未结 5 2063
我寻月下人不归
我寻月下人不归 2021-01-24 21:42
$link = mysql_connect(\'localhost\', $username, $password);
if (!$link) 
{
     die(\'Could not connect: \' . mysql_error());
}

I get this error:

5条回答
  •  清歌不尽
    2021-01-24 22:09

    Your $password variable is empty ((using password: NO)) then you trying log into www-data user without password, and server result is access denied. Propably this user have setted password.

提交回复
热议问题