tp5.1 SQLSTATE[HY000] [2013]报错

浏览:330 发布日期:2020/04/21 分类:ThinkPHP5专区
[2013] PDOException in Connection.php line 528
SQLSTATE[HY000] [2013] Lost connection to MySQL server at 'reading initial communication packet', system error: 111
try {
if (empty($config['dsn'])) {
$config['dsn'] = $this->parseDsn($config);
}

if ($config['debug']) {
$startTime = microtime(true);
}

$this->links[$linkNum] = new PDO($config['dsn'], $config['username'], $config['password'], $params);

if ($config['debug']) {
// 记录数据库连接信息
$this->log('[ DB ] CONNECT:[ UseTime:' . number_format(microtime(true) - $startTime, 6) . 's ] ' . $config['dsn']);
}

return $this->links[$linkNum];
} catch (\PDOException $e) {
if ($autoConnection) {

请问怎么回事呀,在本地测试都正常的,上传空间后就不行了,远程数据库我用navicat是能够连接上的,请教各位指点一下呢,搞一天了
最佳答案
评论( 相关
后面还有条评论,点击查看>>