具有php7.0的Ubuntu 20.04 PhpMyAdmin错误500-caching_sha2_password]

问题描述

当我在Ubuntu 20.04上使用7.0版本的PHP并尝试打开时:http:// localhost / PHPmyadmin /-然后:HTTP ERROR 500 appers。

当我尝试打开与数据库连接的任何其他页面时,会出现:

  • “消息:MysqLi :: real_connect():服务器请求身份验证 客户端未知的方法[caching_sha2_password]“
  • MysqLi :: real_connect():(HY000 / 2054):服务器请求了 客户端未知的身份验证方法

enter image description here enter image description here

当我将PHP版本更改为7.4时-一切正常(PHPmyadnim和页面

我检查了7.0版的日志(tail /var/log/apache2/error.log),但出现错误

  • PHP分析错误:语法错误,意外的'const'(T_CONST),/ usr / share / PHP / PHPMyAdmin / MoTranslator / Translator.PHP中第58行的预期变量(T_VARIABLE)

enter image description here

我尝试安装:

sudo apt-get install PHP-mbstring PHP7.0-mbstring PHP-gettext

但是每次我这样做时,我都会得到信息:“无法找到PHP-gettext包”

PHP 7.4版上,一切正常。但是我想使用7.0版的PHP

我尝试过:

解决方法

在运行7.1.16之前的PHP版本或7.2.4之前的PHP 7.2时,请将MySQL 8服务器的默认密码插件设置为iter(),否则即使{ {1}}未使用。

这是因为MySQL 8默认为mainWindow = new BrowserWindow({ icon: './pathTo/myIcon.ico' // <-- this line }); ,这是旧版PHP(mysqlnd)版本无法识别的插件。相反,可以通过在mysql_native_password中设置The server requested authentication method unknown to the client [caching_sha2_password]来更改它。 caching_sha2_password将在以后的PHP版本中得到支持。

来源https://www.php.net/manual/en/mysqli.requirements.php

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...