Bug #76651 [Opn]: Can't establish a connection to MySQL after upgrading PHP from 7.2.7 to 7.2.8

From: Date: Mon, 23 Jul 2018 15:09:11 +0000
Subject: Bug #76651 [Opn]: Can't establish a connection to MySQL after upgrading PHP from 7.2.7 to 7.2.8
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-216415@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=76651&edit=1 ID: 76651 Updated by: johannes@php.net Reported by: itaylorswift365 at gmail dot com Summary: Can't establish a connection to MySQL after upgrading PHP from 7.2.7 to 7.2.8 Status: Open Type: Bug Package: MySQLi related Operating System: Debian 9.5 x64 PHP Version: 7.2.8 -Assigned To: +Assigned To: mysql Block user comment: N Private report: N New Comment: Which MySQL server version are you using? Whats the value of SELECT @@default_authebticatiin_plugin? Previous Comments: ------------------------------------------------------------------------ [2018-07-22 01:16:16] no at mail dot here This bug also crops up on PHP 7.2.8 for Windows (x86 and x64). phpMyAdmin is affected as well. ------------------------------------------------------------------------ [2018-07-21 18:30:10] itaylorswift365 at gmail dot com Everything is fine on PHP 7.2.7. ------------------------------------------------------------------------ [2018-07-21 18:26:51] itaylorswift365 at gmail dot com Description: ------------ From PHP 7.2.0 to 7.2.7, everytime I compile and build PHP from source with this opinions: ./configure --enable-mysqlnd --with-mysqli=mysqlnd --with-mysql-sock=/tmp/mysql.sock --with-pdo-mysql=mysqlnd {...} and everything looks fine. PHP can connect to MySQL successfully. But this time I compiled PHP 7.2.8 with the same configure opinions, the compile and build process was succeeded but after restarting php-fpm, I got an error that "MySQL Servr is Gone". But MySQL process was still running out there, I was confused. So I wrote a PHP script to figure out where the problem was. And I got this error "Connect DATABASE Error TYPE: 2002: Permission denied". So I checked the socket file permission of both PHP and MySQL, I got this: php socket file permission was 0660 while MySQL was 0777. And I made another test that if I downgrade PHP from 7.2.8 to 7.2.7, after restarting php-fpm, it could establish a successful connection to MySQL. Running the same script got "Success: A proper connection to MySQL was made! The database is great. Host information: Localhost via UNIX socket" So running PHP 7.2.7 looks fine but there is a MySQL connection problem if running PHP 7.2.8. (I use the default php.ini) Test script: --------------- <?php $link = mysqli_connect("localhost", "user", "pass", "dbname"); if (!$link) { echo "Error: Unable to connect to MySQL." . PHP_EOL; echo "Debugging errno: " . mysqli_connect_errno() . PHP_EOL; echo "Debugging error: " . mysqli_connect_error() . PHP_EOL; exit; } echo "Success: A proper connection to MySQL was made! The database is great." . PHP_EOL; echo "Host information: " . mysqli_get_host_info($link) . PHP_EOL; mysqli_close($link); ?> Expected result: ---------------- Success: A proper connection to MySQL was made! The my_db database is great. Host information: Localhost via UNIX socket Actual result: -------------- Connect DATABASE Error TYPE: 2002: Permission denied ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=76651&edit=1

« previous php.bugs (#216415) next »