php7.4 mysqli与"gone away"超时. [英] php7.4 mysqli times out with "gone away"
问题描述
我刚刚安装了php7.4,看起来一切正常,但是当我尝试使用phpmyadmin时,我无法: 注意在此安装之前在php7.3中工作正常
I have just installed php7.4, everything seems ok but when I try to go on my phpmyadmin, I can't : Note works fine in php7.3 before this installation
错误是:
mysqli_real_connect(): Unexpected server response while doing caching_sha2 auth: 109
mysqli_real_connect(): (HY000/2006): MySQL server has gone away
寻找我的php mysql库:php7.4-mysql
.已安装.
looking my php mysql library :php7.4-mysql
. it's installed.
忘记什么? 谢谢.
NOTICE: Not enabling PHP 7.4 FPM by default.
NOTICE: To enable PHP 7.4 FPM in Apache2 do:
NOTICE: a2enmod proxy_fcgi setenvif
NOTICE: a2enconf php7.4-fpm
NOTICE: You are seeing this message because you have apache2 package installed.
Traitement des actions différées (« triggers ») pour libapache2-mod-php7.4 (7.4.
0-1+ubuntu19.10.1+deb.sury.org+1) ...
apt-cache policy php7.4
php7.4:
Installé : 7.4.0-1+ubuntu19.10.1+deb.sury.org+1
Candidat : 7.4.0-1+ubuntu19.10.1+deb.sury.org+1
Table de version :
*** 7.4.0-1+ubuntu19.10.1+deb.sury.org+1 500
500 http://ppa.launchpad.net/ondrej/php/ubuntu eoan/main amd64 Packages
500 http://ppa.launchpad.net/ondrej/php/ubuntu eoan/main i386 Packages
100 /var/lib/dpkg/status
推荐答案
我也遇到了同样的问题,但是PHP7.4-mysql-pdo
不能使用mysql_native_password
,即使在my.cnf
中进行设置时也无法使用mysql_native_password
I had the same issue, but using mysql_native_password
was not possible with PHP7.4-mysql-pdo
, even on setting in my.cnf
as it worked on PHP7.3-mysql-pdo
.
我必须使用以下查询更改每个用户:
I had to alter every user with this query:
ALTER USER 'username'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'password';
其中username
是数据库用户名,password
是数据库用户的密码.
where username
is the database username and password
is the password of the database user.
这篇关于php7.4 mysqli与"gone away"超时.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!