我正在使用第 3 方 API 在数据库中插入数据。我已经在我的本地计算机中遇到了这个问题,我将它设置max_allowed_packet为其他帖子所说的,它对我有用。但现在我正在使用我们的 linux 远程服务器来插入数据。我找不到那个my.ini或一些配置文件,但有类似的文件,这里命名50-server.cnf的是它的一些内容
#
# * Fine Tuning
#
key_buffer_size = 16M
max_allowed_packet = 1024M
thread_stack = 192K
thread_cache_size = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam_recover_options = BACKUP
#max_connections = 100
#table_cache = 64
#thread_concurrency = 10
#
# * Query Cache Configuration
#
query_cache_limit = 32M
query_cache_size = 1024M
为了设置全局变量,我还在我们的 linux 远程终端中编写了一堆查询。这是其中的一些
sudo mysql
SET SESSION wait_timeout = 999999;
SET SESSION net_read_timeout = 1000
SET GLOBAL connect_timeout = 1000;
之后我运行
sudo /etc/init.d/mysql restart
然后我执行我的控制器功能但我仍然得到
PDOStatement::execute(): MySQL server has gone away
我在用
mysql:
mysql Ver 15.1 Distrib 10.1.43-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
Linux:
Linux ip-172-31-16-16 4.15.0-1054-aws #56-Ubuntu SMP Thu Nov 7 16:15:59 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
PHP:
Zend Engine v3.3.11, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.11-1+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
玛丽亚数据库:
mariadb Ver 15.1 Distrib 10.1.43-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
有人可以告诉我这有什么问题吗?