提示: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(349): CSnsDbTools->execute('SELECT u.*,i.cl...', Array)
#3 /data/www/cntradeinfo.com/www/plugins/default/controllers/ShopController.php(21): DefaultModel->getUserById(7877)
#4 /data/www/cntradeinfo.com/framework/web/actions/CInlineAction.php(32): ShopController->actionShopindex()
#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('shopindex')
#9 /data/www/cntradeinfo.com/framework/web/CSnsWebApplication.php(89): CSnsWebApplication->runController('default/shop/sh...')
#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-11-25 09:23:20