-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Open
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