我在本地服务器创建了两个数据库,test 和 bbs
使用的时候只有test 可以连接上,bbs 连接不了
function db_connect()
{
   $db = @new mysqli("127.0.0.1", "developer", "123456", "test");
   if (!$db)
      return false;
   return $db;
}
上边这个可以连接到,下边这个却不可以
function db_connect()
{
   $db = @new mysqli("127.0.0.1", "developer", "123456", "bbs");
   if (!$db)
      return false;
   return $db;
}

解决方案 »

  1.   

     Access denied for user 'developer'@'localhost' to database 'bbs' mysqli::query() [mysqli.query]: Couldn't fetch mysqli
    Enter password: ******
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 205 to server version: 5.0.22-community-ntType 'help;' or '\h' for help. Type '\c' to clear the buffer.mysql> select user,host from mysql.user;
    +-----------+-----------+
    | user      | host      |
    +-----------+-----------+
    | developer | %         |
    | root      | %         |
    | developer | localhost |
    | root      | localhost |
    +-----------+-----------+
    4 rows in set (0.01 sec)mysql>
    developer 怎么连接不到这个数据库那
      

  2.   

    developer 用户没有操作 bbs 的权限,你应给给足权限。
      

  3.   

    是好了,记得付过权的,看过记录付权没选中bbs,,哦,总是出这种低级的错误呀