前几天连接都正确,今天连却报错了。。我没改动过任何文件代码如下:
function db_connect(){
  $result=new mysqli('localhost','chenzhi','good','books');
  if(!$result){
   throw new Exception('access denied .');
  }else{
   return $result;
  }
}
错误信息:Warning: mysqli::mysqli() [mysqli.mysqli]: (28000/1045): Access denied for user 'chenzhi'@'localhost' (using password: YES) in D:\wamp\Apache2.2\htdocs\books\db_fns.php on line 7
我在cmd下写入:mysql -u chenzhi -p 
               good;是可以访问数据库的