phpmyadmin / phpmyadmin/phpmyadmin
A PHP warning is given when the SQL server is shutdown or restarted
Open
Nobody has claimed this yet.
Bug
- Dominant language
- PHP
- Stars
- 7.9k
- Forks
- 3.6k
- Avg merge
- 4d 18h
- Merged PRs (30d)
- 36
Description
Describe the bug
A PHP warning is given when the SQL server is shutdown or restarted, and a query was still executing.
To Reproduce
Steps to reproduce the behavior:
- Execute a query that takes long enough.
- Visit the login page in the same browser in a new tab.
- Shutdown or restart the SQL server.
- See error
Expected behavior
The warning shouldn't be given.
Screenshots

Server configuration
- Operating system: Windows
- Web server: nginx/1.19.8
- Database version: 5.7.32
- PHP version: 8.0.3
- phpMyAdmin version: 5.1.0
Client configuration
- Browser: Firefox
- Operating system: Windows
Additional context
Warning in .\libraries\classes\Dbal\DbiMysqli.php#244
mysqli::query(): (08S01/1053): Server shutdown in progress
Backtrace
.\libraries\classes\Dbal\DbiMysqli.php#244: mysqli->query(
string 'SELECT * FROM `tbl_users` WHERE `username` IS NOT NULL ',
integer 0,
)
.\libraries\classes\DatabaseInterface.php#213: PhpMyAdmin\Dbal\DbiMysqli->realQuery(
string 'SELECT * FROM `tbl_users` WHERE `username` IS NOT NULL ',
,
integer 0,
)
.\libraries\classes\Sql.php#817: PhpMyAdmin\DatabaseInterface->tryQuery(string 'SELECT * FROM `tbl_users` WHERE `username` IS NOT NULL ')
.\libraries\classes\Sql.php#907: PhpMyAdmin\Sql->countQueryResults(
integer 25,
boolean false,
string 'db_name',
string 'tbl_users',
array,
)
.\libraries\classes\Sql.php#1805: PhpMyAdmin\Sql->executeTheQuery(
array,
string 'SELECT * FROM `tbl_users` WHERE `username` IS NOT NULL LIMIT 0, 25 ',
boolean false,
string 'db_name',
string 'tbl_users',
NULL,
NULL,
NULL,
)
.\libraries\classes\Controllers\ImportController.php#816: PhpMyAdmin\Sql->executeQueryAndGetQueryResponse(
array,
boolean false,
string 'db_name',
string 'tbl_users',
NULL,
NULL,
NULL,
NULL,
NULL,
string 'index.php?route=/table/structure',
string './themes/pmahomme/img/',
NULL,
NULL,
string 'SELECT * FROM `tbl_users` WHERE `username` IS NOT NULL',
NULL,
)
.\libraries\classes\Routing.php#186: PhpMyAdmin\Controllers\ImportController->index(array)
.\index.php#18: PhpMyAdmin\Routing::callControllerForRoute(
string '/import',
,
,
)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with libraries/classes/Dbal/DbiMysqli.php at line 244, then follow the call through libraries/classes/DatabaseInterface.php and libraries/classes/Sql.php. Reproduce the long-running query and SQL-server restart described in the issue, and verify that the server-shutdown condition no longer produces a PHP warning.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mysql, php
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100