我有一个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。
我进行了搜索,发现了几篇文章,但没有一种解决方法有效
当我打电话时失败:
$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)