Re: PHP 7.4.0 + MySQL

From: Date: Sun, 08 Sep 2019 04:18:41 +0000
Subject: Re: PHP 7.4.0 + MySQL
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-326901@lists.php.net to get a copy of this message
Holy crapola! I figured it out. Boy this is a bizarre one. Okay, a long time ago in a galaxy far, far away PHP 7.3.X had this issue also. The workaround was to convince MySQL to use mysql_native_password as the default authentication plugin. This issue was later patched, and I've been running happily without that setting ever since. Whatever the fix was, it apparently hasn't made it into PHP 7.4.0. So, the workaround is to add the following to MySQL's my.ini file and restart the server: default_authentication_plugin = mysql_native_password Basically, PHP 7.4.0 has the ability to login as users using sha256_password(same as 7.3.X) but can only initially connect using mysql_native_password. I think there's also code in there to handle users using caching_sha2_password(MySQL's new default) but I haven't tested that. Anyways, problem solved! For now. Regards, Adam On Sat, Sep 7, 2019 at 2:45 AM Christoph M. Becker <cmbecker69@gmx.de> wrote: > On 07.09.2019 at 02:58, Adam W. Dace wrote: > > > I recently attempted upgrading my server, to prepare for v7.4 release, > and > > am having some problems connecting to a MySQL database running on the > same > > server. > > > > Currently, I'm running Apache v2.4.41 and PHP v7.3.8 with no problems. > > I'm having problems connecting with both phpMyAdmin and WordPress, > > though I'll keep the discussion to phpMyAdmin for simplicity's sake. > > > > I feel like I'm missing some sort of configuration, though I have no idea > > what it might be. > > > > Information To Follow: > > > > OS: DragonFly BSD Development > > Apache: v2.4.41 (stable) > > PHP: 7.4.0beta4 > > MySQL: v8.0.16 (stable) > > phpMyAdmin: v4.9.0.1 (stable) > > > > AutoConf: ./configure --with-apxs2=/usr/local/sbin/apxs --disable-debug > > --enable-bcmath --enable-gd --enable-mbstring --enable-mysqlnd > > --enable-sockets --with-jpeg --with-mysqli --with-openssl --with-zlib > > > > phpMyAdmin Configuration: > > > > $cfg['Servers'][$i]['verbose'] = 'Contact'; > > $cfg['Servers'][$i]['host'] = 'localhost'; > > $cfg['Servers'][$i]['port'] = '3306'; > > $cfg['Servers'][$i]['socket'] = ''; > > $cfg['Servers'][$i]['auth_type'] = 'cookie'; > > $cfg['Servers'][$i]['user'] = ''; > > $cfg['Servers'][$i]['password'] = ''; > > > > With a similar autoconf and PHP v7.3.8 I have no problems logging in as a > > localhost user, viewing databases, making changes, etc. This is all done > > via /tmp/mysql.sock. > > > > However, when I try the same configuration with PHP v7.4.0 I get a slight > > delay and then the fatal error "MySQL server has gone away.". I believe > > this was from mysqli_connect_real(). > > > > I've tried changing around phpMyAdmin's configuration...no luck. I've > > tried specifying /tmp/mysql.sock to PHP itself...no luck. > > > > Any help or suggestions would be appreciated. I'm kind of stuck. :) > > Perhaps you're hitting > <https://github.com/phpmyadmin/phpmyadmin/issues/14220>. > > -- > Christoph M. Becker > -- ____________________________________________________________ Adam W. Dace <colonelforbin74@gmail.com> Phone: (815) 355-7285 Instant Messenger: AIM & Yahoo! IM - colonelforbin74 | ICQ - #39374451 Google Profile: https://plus.google.com/u/0/109309036874332290399/about

« previous php.general (#326901) next »