mysql访问被拒绝用户'www-data'@'localhost'

时间:2016-05-23 23:58:30

标签: mysql

我试图连接到我的网站时碰到了墙,现在它工作正常,直到我添加了一个shoutbox但我认为它没有导致它被用户'www-data'@'拒绝访问localhost'(使用密码:NO)。

我有几个网站正在运行,只有这一个网站似乎遇到了这个问题我已经重置了密码但仍然没有运气请有人帮助我。

的config.php

$site_settings['mysql_host'] = "localhost";
$site_settings['mysql_user'] = "root";
$site_settings['mysql_pass'] = "PasswordHash";
$site_settings['mysql_db']   = "project";

cms.php

    function dbconn()
{
    global $site_settings;

if (!@mysql_connect($site_settings['mysql_host'], $site_settings['mysql_user'], $site_settings['mysql_pass']))
{
  switch (mysql_errno())
  {
    case 1040:
    case 2002:
        if ($_SERVER['REQUEST_METHOD'] == "GET")
            die("<html><head><meta http-equiv='refresh' content=\"5 $_SERVER[REQUEST_URI]\"></head><body><table border='0' width='100%' height='100%'><tr><td><h3 align='center'>The server load is very high at the moment. Retrying, please wait...</h3></td></tr></table></body></html>");
        else
            die("Too many users. Please press the Refresh button in your browser to retry.");
    default:
        die("[" . mysql_errno() . "] dbconn: mysql_connect: " . mysql_error());
  }
}
mysql_select_db($site_settings['mysql_db'])
    or die('dbconn: mysql_select_db: ' . mysql_error());

mysql_set_charset('utf8');
}

屏幕截图 - http://prntscr.com/b7nnc7

P.S我得到了error_reporting(E_ALL);完好无损。

0 个答案:

没有答案