提示:500

SQLSTATE[HY000] [2003] Can't connect to MySQL server on '127.0.0.1' (111)

源文件

/data/www/byb2b.com/framework/db/CSnsConnection.php(45)

00033:         try
00034:         {
00035:             
00036:             $this->dbh = new PDO($connstr, $dsn['user'], $dsn['pass']);
00037:             $serverInfo = $this->dbh->getAttribute(PDO::ATTR_SERVER_INFO);
00038:             if ($serverInfo == 'MySQL server has gone away')
00039:                 $this->dbh = new PDO($connstr, $dsn['user'], $dsn['pass']);    
00040: 
00041:             $this->initConnection($this->dbh, $dsn);
00042:         }
00043:         catch(PDOException $e)
00044:         {
00045: throw new CSnsDbException($e->getMessage());
00046: } 00047: } 00048: 00049: /** 00050: * 取当前connection 00051: * 00052: * @return 00053: * 数据库连接对象 00054: */ 00055: public function getConnection() 00056: { 00057: return $this->dbh;

堆栈追踪

#0 /data/www/byb2b.com/framework/db/CSnsConnection.php(93): CSnsConnection->__construct('mysql://ydbzhan...')
#1 /data/www/byb2b.com/framework/db/CSnsDbTools.php(199): CSnsConnection::getInstance('mysql://ydbzhan...')
#2 /data/www/byb2b.com/www/plugins/default/class/impls/DefaultModel.php(216): CSnsDbTools->execute('SELECT * FROM b...')
#3 /data/www/byb2b.com/www/plugins/default/controllers/DefaultController.php(21): DefaultModel->getClassById('9,1,11,19,18,2')
#4 /data/www/byb2b.com/framework/web/actions/CInlineAction.php(32): DefaultController->actionIndex()
#5 /data/www/byb2b.com/framework/web/CSnsController.php(120): CInlineAction->run()
#6 /data/www/byb2b.com/framework/web/CSnsController.php(104): CSnsController->runAction(Object(CInlineAction))
#7 /data/www/byb2b.com/framework/web/CSnsController.php(93): CSnsController->runActionWithFilters(Object(CInlineAction), Array)
#8 /data/www/byb2b.com/framework/web/CSnsWebApplication.php(442): CSnsController->run('index')
#9 /data/www/byb2b.com/framework/web/CSnsWebApplication.php(89): CSnsWebApplication->runController('default/default...')
#10 /data/www/byb2b.com/framework/base/CSnsApplication.php(137): CSnsWebApplication->processRequest()
#11 /data/www/byb2b.com/www/web/index.php(22): CApplication->run()
#12 {main}

当网页服务器处理您的请求时, 发生以上错误.

如果您认为此错误是服务器造成的,请与管理员联系 the webmaster.

谢谢.

2024-11-15 02:45:05