PHP MySQLi无法识别登录信息

问题描述 投票:0回答:1

我无法使用mysqli类登录数据库。

我遇到下一个错误:

Warning: mysql_query(): Access denied for user 'www-data'@'localhost' (using password: NO) 

我有下一个代码:

$this->mysqlCon = new mysqli($siteConfig['db']['hostname'], $siteConfig['db']['username'], $siteConfig['db']['password'], $siteConfig['db']['database']);

var_dump()的[$siteConfig['db']返回:

array(4) {
  ["hostname"]=>
  string(9) "localhost"
  ["username"]=>
  string(4) "root"
  ["password"]=>
  string(*) "***Censored***"
  ["database"]=>
  string(*) "***Censored***"
}

我的VPS正在运行Debian 6 32位

php mysqli database-connection
1个回答
1
投票
Warning: mysql_query()
             ^---------------------- notice something? :)

您似乎在代码中混用了mysqlmysqli

© www.soinside.com 2019 - 2024. All rights reserved.