簡體   English   中英

MantisBT(Ubuntu 18.04)中的應用程序錯誤#400 [錯誤:2045] [錯誤:1045]

[英]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

升級過程遇到錯誤,將無法繼續。

訪問頁面中的錯誤MantisBT

phpmyadmin中的錯誤

以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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM