[英]Application error #400 [error:2045] [error:1045] in MantisBT (Ubuntu 18.04)
更新(通过-apt更新和apt升级)后,无法访问MantisBT的安装。 数据库和用户是完整的。 可以通过SSH完整访问服务器(VPS)。
与数据库的连接失败。 数据库返回的错误是#2054:客户端未知的服务器请求的身份验证方法使用Web浏览器中的“返回”按钮返回上一页。 在那里,您可以纠正此错误通知中已确定的问题,或选择其他操作。 您也可以单击菜单栏中的选项直接进入新部分。
phpmyadmin中的错误:
2054-服务器请求的客户端身份验证方法未知
mysqli_real_connect():服务器请求客户端未知的身份验证方法[caching_sha2_password]
mysqli_real_connect():(HY000 / 2054):服务器请求客户端未知的身份验证方法
Ubuntu 18.04.2 LTS
发行:18.04
PHP 7.2.15-0ubuntu0.18.04.1(CLI)(建立:2019年2月8日14:54:22)(NTS)
适用于x86_64上的Linux的mysql Ver 8.0.15(MySQL Community Server-GPL)
服务器版本:Apache / 2.4.29(Ubuntu)
我修改了MySQL配置:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'rootpassword'
但我收到以下错误:
ERROR 3009 (HY000): Column count of mysql.user is wrong. Expected 51, found 50. Created with MySQL 80013, now running 80015. Please use mysql_upgrade to fix this error.
尝试更新MySQL实例时:
mysql_upgrade: Got error: 1045: Access denied for user 'root'@'localhost' (using password: NO) while connecting to the MySQL server
升级过程遇到错误,将无法继续。
以root用户登录MySQL控制台:
mysql -u root -p<password>
运行以下代码:
ALTER USER root IDENTIFIED WITH mysql_native_password BY 'NEW PASSWORD';
您必须将“新密码”更改为新密码,然后尝试登录。
希望这会有所帮助。
我使用以下命令更新了表的结构:
mysql_upgrade -u root -p --force
结果是:
Checking server version.
Running queries to upgrade MySQL server.
Upgrading system table data.
Checking system database.
mysql.columns_priv Table is already up to date
mysql.component Table is already up to date
mysql.db Table is already up to date
mysql.default_roles Table is already up to date
mysql.engine_cost Table is already up to date
mysql.func Table is already up to date
mysql.general_log Table is already up to date
mysql.global_grants Table is already up to date
mysql.gtid_executed Table is already up to date
mysql.help_category Table is already up to date
mysql.help_keyword Table is already up to date
mysql.help_relation Table is already up to date
mysql.help_topic Table is already up to date
mysql.innodb_index_stats Table is already up to date
mysql.innodb_table_stats Table is already up to date
mysql.password_history Table is already up to date
mysql.plugin Table is already up to date
mysql.procs_priv Table is already up to date
mysql.proxies_priv Table is already up to date
mysql.role_edges Table is already up to date
mysql.server_cost Table is already up to date
mysql.servers Table is already up to date
mysql.slave_master_info Table is already up to date
mysql.slave_relay_log_info Table is already up to date
mysql.slave_worker_info Table is already up to date
mysql.slow_log Table is already up to date
mysql.tables_priv Table is already up to date
mysql.time_zone Table is already up to date
mysql.time_zone_leap_second Table is already up to date
mysql.time_zone_name Table is already up to date
mysql.time_zone_transition Table is already up to date
mysql.time_zone_transition_type Table is already up to date
mysql.user Table is already up to date
The sys schema is already up to date (version 2.0.0).
Checking databases.
再次尝试更改root密码时:
ALTER USER root IDENTIFIED WITH mysql_native_password BY 'newpassword';
答案是:
ERROR 1396 (HY000): Operation ALTER USER failed for 'root'@'%'
在查询该错误时,我找到了几种解决方案,其中一个有趣的是:
我知道这是一个很老的问题,但似乎仍未完全解决。 我遇到了同样的问题,并按照以下方式解决了这个问题。
在MySQL的my.ini文件中,我将default_authentication_plugin更改为mysql_native_password
'default_authentication_plugin = caching_sha2_password'注释掉default_authentication_plugin = mysql_native_password然后,在MySQL Workbench中,我将模式的密码类型设置为标准密码,而不是sha2-something。 然后就可以了。
MySQL是8.0版,PHP是7.26在Window 7上运行。
总而言之,我认为我们应该在MySQL配置文件中进行以下调整:
' default_authentication_plugin=caching_sha2_password ' comment out
default_authentication_plugin=mysql_native_password
WAMP中的配置文件是my.ini
,LAMP中的文件是未知的,并且(对我来说)位置是当我向整个社区寻求帮助时。
提前致谢。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.