【问题标题】:Application error #400 [error:2045] [error:1045] in MantisBT (Ubuntu 18.04)MantisBT (Ubuntu 18.04) 中的应用程序错误 #400 [error:2045] [error:1045]
【发布时间】:2019-02-15 03:23:54
【问题描述】:

更新后(通过 -apt update 和 apt upgrade)访问 MantisBT 的安装变得无用了。数据库和用户完好无损。 通过 SSH 访问服务器 (VPS) 是可用且完整的。

与数据库的连接失败。由返回的错误 数据库是#2054:服务器请求的身份验证方法 客户端未知 使用 Web 浏览器中的 «Back» 按钮 回到前面的页面。在那里您可以纠正以下问题 已在此错误通知中识别或选择另一个 行动。您也可以点击菜单栏中的一个选项直接进入 到一个新的部分。

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)

mysql Ver 8.0.15 for Linux on x86_64(MySQL 社区服务器 - 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

升级过程遇到错误,将无法继续。

Error in access page MantisBT

Error in phpmyadmin

【问题讨论】:

标签: php mysql ubuntu-18.04 mantis


【解决方案1】:

以 root 用户登录 MySQL 控制台:

mysql -u root -p<password>

运行以下代码:

ALTER USER root IDENTIFIED WITH mysql_native_password BY 'NEW PASSWORD';

您必须将“新密码”更改为新密码,然后尝试登录。

希望这会有所帮助。

【讨论】:

  • 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_upgrade: Got error: 1045: Access denied for user 'root'@'localhost' (using password: NO) while connecting to the MySQL server Upgrade process encountered error and will not continue.
  • mysql -u root -p<password> 你把 改成你的密码了吗?
  • 尝试mysql -u root -p不带密码
  • 我可以进入 MySQL (mysql>),当我输入:ALTER USER root IDENTIFIED WITH mysql_native_password BY 'MYNEWPASSWORD'; 时出现以下错误: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 并显示以下错误:mysql_upgrade: Got error: 1045: Access denied for user 'root' @ 'localhost' (using password: NO) while connecting to the MySQL server Upgrade process encountered error and will not continue.
【解决方案2】:

我用命令更新了表的结构:

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-东西。然后就可以了。

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 中的文件是未知的,位置(对我而言)是当我向整个社区寻求帮助时。

提前致谢。

【讨论】:

    猜你喜欢
    • 2014-12-04
    • 1970-01-01
    • 2023-03-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-09
    • 2023-03-15
    • 2018-11-20
    相关资源
    最近更新 更多