1

我有一个 TCP 套接字侦听器来接收 Symfony 4 命令中的数据。当我收到数据时,我会处理数据以试图找到一个实体(来自数据库)。

我能够从 TCP 接收多个数据并毫无问题地运行我的所有代码。但是突然,出现如下错误:

In DBALException.php line 172:

  An exception occurred while executing 'SELECT t0.id AS id_1, t0.name AS name_2, t0.serialnumber AS serialnumber_3,   
  t0.location AS location_4, t0.latitude AS latitude_5, t0.longitude AS longitude_6, t0.host AS host_7, t0.port AS po  
  rt_8, t0.enabled AS enabled_9, t0.mac_address AS mac_address_10, t0.camera_model_id AS camera_model_id_11 FROM devi  
  ce t0 WHERE t0.mac_address = ? LIMIT 1' with params ["58:03:fb:a2:46:6c"]:                                           

  Warning: Error while sending QUERY packet. PID=2989                                                                  


In PDOStatement.php line 117:

  Warning: Error while sending QUERY packet. PID=2989

我有一个 Debian 9 服务器,运行 PHP 7.3、MariaDB 和 Apache 2。

我进行了搜索,发现了几个帖子,但没有一个解决方案有效:

  • 将“wait_timeout”的值增加到 28800。
  • 将“max_allowed_pa​​cket”的值增加到 536870912。

当我打电话时它失败了:

$device = $this->deviceRepository->findOneBy(array('macAddress' => (string)$xml->macAddress));

MARIADB 显示:

MariaDB [database]> SHOW GLOBAL VARIABLES LIKE "wait_timeout";
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wait_timeout  | 10    |
+---------------+-------+
1 row in set (0.001 sec)

MariaDB [database]> SHOW GLOBAL VARIABLES LIKE "max_allowed_packet";
+--------------------+-----------+
| Variable_name      | Value     |
+--------------------+-----------+
| max_allowed_packet | 536870912 |
+--------------------+-----------+
1 row in set (0.001 sec)
4

0 回答 0