php hangs when auth_socket is set for the user
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 40.4k
- Forks
- 8.1k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 96
Description
Description
The following code:
<?php
$mysqli = new mysqli("localhost", "root", "...", "mysql");
echo $mysqli->host_info . "\n";
with a local MySQL 8.4 User like this:
*************************** 6. row ***************************
Host: localhost
User: root
...
plugin: auth_socket
Results in php hanging until MySQL timeouts instead of connecting to MySQL
Changing the auth plugin to caching_sha2_password solves the situation. I did not test what happens when I don't set the password or explicitly use the socket.
PHP Version
PHP 8.4.1 (cli) (built: Nov 25 2024 18:04:19) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.4.1, Copyright (c) Zend Technologies
with Zend OPcache v8.4.1, Copyright (c), by Zend Technologies
Operating System
Ubuntu 24.04
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 by reproducing the mysqli constructor example against MySQL 8.4 on Ubuntu 24.04 with the user configured for auth_socket, then compare it with caching_sha2_password and the explicitly mentioned socket and password variations. Trace the connection path until the hang occurs; done means the auth_socket case has a defined, non-hanging behavior or a confirmed fix with a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mysql, php
- Domain
- database
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100