phpMyAdmin not showing output for SQL query longer than 0.5s – no error, no results, just hides query box

huangapple go评论61阅读模式
英文:

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 &gt;= 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 &lt;= 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[&#39;Servers&#39;][$i][&#39;port&#39;] = 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

huangapple
  • 本文由 发表于 2023年2月23日 23:29:12
  • 转载请务必保留本文链接:https://go.coder-hub.com/75546921.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定