-2

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?

Arth
  • 12,789
  • 5
  • 37
  • 69
  • I'm not the downvoter but I guess it's hard to help you. Can you say how you installed your environment? Is it xamp? If so, there is a php error log as well for mysql. I would advise you to look there :) – Wimanicesir Feb 23 '23 at 15:42
  • @Wimanicesir Thanks, it's a cloud server running an Amazon Linux 2 LAMP stack – Arth Feb 23 '23 at 15:48
  • Did you try this already? https://stackoverflow.com/questions/36102721/check-php-errors-log-in-my-ec2-instance-running-amazon-linux – Wimanicesir Feb 23 '23 at 16:04
  • @Wimanicesir Yes, have updated the question – Arth Feb 23 '23 at 16:26

1 Answers1

0

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

Arth
  • 12,789
  • 5
  • 37
  • 69