数据库停止后打开网址报错时出现数据库名和密码,求助大侠,怎么让报错时不出现数据库名和密码。停止数据库时报错时如下:(红色字段就是数据库名和密码)
[2002] PDOException in Connection.php line 295
SQLSTATE[HY000] [2002] No such file or directory
$this->fetchType = $config['result_type'];
}
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']) {
// 记录数据库连接信息
Log::record('[ DB ] CONNECT:[ UseTime:' . number_format(microtime(true) - $startTime, 6) . 's ] ' . $config['dsn'], 'sql');
}
} catch (\PDOException $e) {
if ($autoConnection) {
Log::record($e->getMessage(), 'error');
return $this->connect($autoConnection, $linkNum);
} else {
Call Stack
in Connection.php line 295
at PDO->__construct('mysql:host=localhost...', 'www_000000_com', 'hEDgt56hg688890WZ', [0, 2, 0, ...]) in Connection.php line 295
at Connection->connect() in Connection.php line 995
at Connection->initConnect(false) in Connection.php line 348
at Connection->query('SHOW COLUMNS FROM `x...', [], false, true) in Mysql.php line 65下面还有好多代码省去
|
|