Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
586 views
in Technique[技术] by (71.8m points)

php - Homebrew PHP 7.4升级在MacOS 10.15.1 Catalina上失败(Homebrew PHP 7.4 upgrade fails on MacOS 10.15.1 Catalina)

My attempts to upgrade homebrew PHP 7.3.12 to PHP 7.4.0 have failed.

(我尝试将自制的PHP 7.3.12升级到PHP 7.4.0失败。)

Here's what I did:

(这是我所做的:)

brew update
sudo brew services stop php
brew upgrade
brew cleanup
brew doctor
sudo brew services start php
brew services list
sudo reboot now

Here's what I expected:

(这是我的期望:)

The server to come back up as expected.

(服务器将按预期恢复。)

Here's what happened:

(这是发生了什么:)

WordPress 5.3 frontend and backend both report the dreaded "Error establishing a database connection" error.

(WordPress 5.3前端和后端均报告可怕的“建立数据库连接错误”错误。)

phpMyAdmin reports the following three errors:

(phpMyAdmin报告以下三个错误:)

  1. Cannot log in to the MySQL server

    (无法登录MySQL服务器)

  2. mysqli_real_connect(): Unexpected server response while doing caching_sha2 auth: 109

    (mysqli_real_connect():进行caching_sha2认证时服务器意外响应:109)

  3. mysqli_real_connect(): (HY000/2006): MySQL server has gone away

    (mysqli_real_connect():(HY000 / 2006):MySQL服务器已消失)

Here's what I did next:

(这是我接下来要做的:)

Ensured correct username and password for MySQL.

(确保MySQL的用户名和密码正确。)

Ensured correct hostname.

(确保正确的主机名。)

Ensured MySQL is running:

(确保MySQL正在运行:)

mysqladmin -u root -p status
Enter password: 
Uptime: 173  Threads: 2  Questions: 3  Slow queries: 0  Opens: 113  Flush tables: 3  Open tables: 35  Queries per second avg: 0.017

Additional information:

(附加信息:)

My httpd log reports nothing unusual:

(我的httpd日志报告没有异常:)

[Sat Nov 30 20:53:48.021678 2019] [mpm_prefork:notice] [pid 140] AH00163: Apache/2.4.41 (Unix) OpenSSL/1.1.1d configured -- resuming normal operations [Sat Nov 30 20:53:48.021785 2019] [core:notice] [pid 140] AH00094: Command line: '/usr/local/opt/httpd/bin/httpd -D FOREGROUND'

([2019年11月30日星期六20:53:48.021678] [mpm_prefork:notice] [pid 140] AH00163:已配置Apache / 2.4.41(Unix)OpenSSL / 1.1.1d-恢复正常操作[11月30日星期六20:53:48.021785 2019] [core:notice] [pid 140] AH00094:命令行:'/ usr / local / opt / httpd / bin / httpd -D FOREGROUND')

Similarly, my MySQL log reports nothing unusual:

(类似地,我的MySQL日志报告没有异常:)

2019-12-01T03:07:00.6NZ mysqld_safe Logging to '/usr/local/var/mysql/moriarty.local.err'.

(2019-12-01T03:07:00.6NZ mysqld_safe登录到'/usr/local/var/mysql/moriarty.local.err'。)

2019-12-01T03:07:00.6NZ mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql 2019-12-01T03:07:02.994684Z 0 [System] [MY-010116] [Server] /usr/local/opt/mysql/bin/mysqld (mysqld 8.0.18) starting as process 398 2019-12-01T03:07:03.012177Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive 2019-12-01T03:07:06.203718Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.

(2019-12-01T03:07:00.6NZ mysqld_safe使用/ usr / local / var / mysql中的数据库启动mysqld守护进程2019-12-01T03:07:02.994684Z 0 [系统] [MY-010116] [服务器] / usr /本地/ opt / mysql / bin / mysqld(mysqld 8.0.18)作为进程398开始于2019年12月12日-T03:07:03.012177Z 0 [警告] [MY-010159] [服务器]设置lower_case_table_names = 2因为文件系统用于/ usr / local / var / mysql /不区分大小写2019-12-01T03:07:06.203718Z 0 [警告] [MY-010068] [服务器] CA证书ca.pem是自签名的。)

2019-12-01T03:07:06.277615Z 0 [System] [MY-010931] [Server] /usr/local/opt/mysql/bin/mysqld: ready for connections.

(2019-12-01T03:07:06.277615Z 0 [系统] [MY-010931] [服务器] / usr / local / opt / mysql / bin / mysqld:准备连接。)

Version: '8.0.18' socket: '/tmp/mysql.sock' port: 3306 Homebrew.

(版本:'8.0.18'套接字:'/tmp/mysql.sock'端口:3306 Homebrew。)

2019-12-01T03:07:06.337877Z 0 [System] [MY-011323] [Server] X Plugin ready for connections.

(2019-12-01T03:07:06.337877Z 0 [系统] [MY-011323] [服务器] X插件可供连接。)

Socket: '/tmp/mysqlx.sock' bind-address: '127.0.0.1' port: 33060

(套接字:'/tmp/mysqlx.sock'绑定地址:'127.0.0.1'端口:33060)

  ask by Michael Fraase translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

This is a bug.

(这是一个错误。)

I will take a wild guess that it has to do with bumping up the version of mysqlnd client API library version to 7.4.0 from the previous 5.0.12.

(我会做出一个疯狂的猜测,这与将mysqlnd客户端API库版本从以前的5.0.12提升到7.4.0有关。)

While you could temporarily set the default authentication plug-in to native password by adding default_authentication_plugin = mysql_native_password to the [mysqld] section of my.cnf which is QUITE LESS SECURE , I would recommend downgrading php (I can confirm version 7.3.1 runs successfully and probably other 7.3 versions, too) until it is fixed, unless you're using the native password mechanism, anyway.

(通过将default_authentication_plugin = mysql_native_password添加到my.cnf[mysqld]部分( 相当安全) ,可以暂时将默认身份验证插件设置为本地密码,但我建议降级php(我可以确认7.3.1版已成功运行) (可能还有其他7.3版本)),直到它被修复为止,除非您仍然使用本机密码机制。)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...