提示:500

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

源文件

/data/www/cntradeinfo.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/cntradeinfo.com/framework/db/CSnsConnection.php(93): CSnsConnection->__construct('mysql://ydbzhan...')
#1 /data/www/cntradeinfo.com/framework/db/CSnsDbTools.php(199): CSnsConnection::getInstance('mysql://ydbzhan...')
#2 /data/www/cntradeinfo.com/www/plugins/default/class/impls/DefaultModel.php(373): CSnsDbTools->execute('SELECT p.*,i.cl...', Array)
#3 /data/www/cntradeinfo.com/www/plugins/product/controllers/DefaultController.php(67): DefaultModel->getProductById(461872)
#4 /data/www/cntradeinfo.com/framework/web/actions/CInlineAction.php(32): DefaultController->actionproductDetail()
#5 /data/www/cntradeinfo.com/framework/web/CSnsController.php(120): CInlineAction->run()
#6 /data/www/cntradeinfo.com/framework/web/CSnsController.php(104): CSnsController->runAction(Object(CInlineAction))
#7 /data/www/cntradeinfo.com/framework/web/CSnsController.php(93): CSnsController->runActionWithFilters(Object(CInlineAction), Array)
#8 /data/www/cntradeinfo.com/framework/web/CSnsWebApplication.php(442): CSnsController->run('productdetail')
#9 /data/www/cntradeinfo.com/framework/web/CSnsWebApplication.php(89): CSnsWebApplication->runController('product/default...')
#10 /data/www/cntradeinfo.com/framework/base/CSnsApplication.php(137): CSnsWebApplication->processRequest()
#11 /data/www/cntradeinfo.com/www/web/index.php(22): CApplication->run()
#12 {main}

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

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

谢谢.

2024-12-13 07:06:49