英文:
phpMyAdmin not showing output for SQL query longer than 0.5s - no error, no results, just hides query box
问题
我尝试在本地运行的MariaDB 10.5.10服务器上的phpMyAdmin 5.2.0中的SQL选项卡中运行查询,我的PHP版本为8.1.14,我的服务器是运行Amazon Linux 2和Apache 2.4.54与PHP-FPM的EC2实例。
我正在粘贴查询SELECT SLEEP(x)
,其中x >= 0.5
,在SQL选项卡的查询框中;或者运行时间超过0.5秒的任何查询。
当我单击Go时,会出现一个旋转图标,持续的时间与查询运行的时间相符,然后整个SQL选项卡变空,只有一个按钮,上面写着显示查询框。
没有可见的错误,如果我检查页面,也没有JS错误,而且我在服务器日志中找不到异常;/var/log/httpd/*.log
或/var/log/php-fpm/*.log
。
如果我运行SELECT SLEEP(y)
,其中y <= 0.4
;或者运行时间少于0.4秒的查询;则一切都按预期运行。如果我从命令行运行mysql,所有查询也都能正确运行。
发生了什么?我应该在哪里查找问题?
英文:
I'm trying to run a query through the SQL tab in phpMyAdmin 5.2.0 on a local MariaDB 10.5.10 server, my PHP version is 8.1.14, and my box is an EC2 instance running Amazon Linux 2 and Apache 2.4.54 with PHP-FPM
I'm pasting the query SELECT SLEEP(x)
, where x >= 0.5
, in the query box of the SQL pane; or any query that takes longer than 0.5s to run
When I click Go a spinner appears for the relevant number of seconds and then the whole SQL pane goes blank except for a button that says Show query box
There are no errors visible, no JS errors if I inspect the page, and I can't find anything untoward in my server logs; /var/log/httpd/*.log
or /var/log/php-fpm/*.log
If I run SELECT SLEEP(y)
where y <= 0.4
; or a query that takes less than 0.4s to run; everything appears to work as expected. All queries also run correctly if I run mysql from the command line
What's going on? Where should I look to debug this?
答案1
得分: 0
在尝试不同版本的phpMyAdmin后,我成功捕获到在phpMyAdmin 5.2.1中执行0.5秒以上查询时出现的错误:
mysqli::real_connect(): 参数#5($port)必须是?int类型,但提供了字符串
看起来在PHP 8.1中至少存在一个问题,或者当端口值为falsey时存在问题
通过在我的config.inc.php
中添加以下行来解决该问题:
$cfg['Servers'][$i]['port'] = 3306;
这样做也会修复问题,只要是真正的整数
我认为这是一个bug,因为我认为在通过套接字连接时不使用端口 - 所以我在phpmyadmin/phpmyadmin github上开了一个问题
我不知道为什么这不会影响更快的查询。
英文:
After experimenting with different versions of phpMyAdmin I managed to get my hands on an error thrown for the 0.5s+ queries with phpMyAdmin 5.2.1
mysqli::real_connect(): Argument #5 ($port) must be of type ?int, string given
and it looks like there is an issue handling the default server's port value, in PHP 8.1 at least, or any falsey port value
Updating my config.inc.php
with a line
$cfg['Servers'][$i]['port'] = 3306;
fixes the issue, as does any truey integer
I believe this is a bug, as I don't think the port is used when connecting via socket - so I have opened an issue on the phpmyadmin/phpmyadmin github
I have no idea why this wasn't affecting the faster queries
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论