PDO异常“连接过多”

时间:2019-09-19 12:24:06

标签: php mysql pdo server centos7

我有这个例外

PDOException: SQLSTATE[08004] [1040] Too many connections in /var/www/html/secLine/SysLine.php:19 Stack trace: #0 /var/www/html/tool/connection.php(19): PDO->__construct('mysql:charset=u...', 'root', '/ptdslpw@@') #1 /var/www/html/tool/index.php(7): connection->__construct() #2 {main}

我正在使用VPS Centos 7和Mysql Server 8

PDO连接代码

try {
            $this->connection = new PDO("mysql:charset=utf8mb4; host=" . $host
                . "; dbname=" . $db,
                $user, $pass);
            $this->isConnected = true;
        } catch (PDOException $e) {
            echo $e;
        }

0 个答案:

没有答案