如何解決 Amazon RDS for MySQL 資料庫執行個體中的升級前檢查失敗問題?
我想解決當我嘗試升級 Amazon Relational Database Service (Amazon RDS) for MySQL 資料庫執行個體時,我收到的升級前檢查失敗問題。
簡短說明
Amazon RDS 和 Amazon Aurora MySQL 相容版本具有自動預檢功能,可將版本升級期間的非計畫停機時間降到最低。當您將 MySQL 版本從 5.7 升級到 8.0,或從 8.0 升級到 8.4 時,預檢會偵測任何可能影響升級的資料不相容問題。當您的資料庫執行個體出現 升級前檢查失敗時,即會停止 Amazon RDS for MySQL 的版本升級。接著,Amazon RDS 會在 PrePatchCompatibility 日誌檔中提供失敗預檢的詳細資訊。
若要找出並修正問題,請在 Amazon RDS 主控台的日誌與事件下查看日誌檔。
如需 MySQL 預檢的資訊,請參閱 MySQL 網站上的升級檢查工具公用程式。
解決方法
**注意:**如果您在執行 AWS Command Line Interface (AWS CLI) 命令時收到錯誤訊息,請參閱對 AWS CLI 錯誤進行疑難排解。此外,請確定您使用的是最新的 AWS CLI 版本。
查看升級前檢查失敗訊息
若要查看您的日誌檔,請完成以下步驟:
- 開啟 Amazon RDS console (Amazon RDS 主控台)。
- 在導覽窗格中,選擇 Databases (資料庫),然後選取您要升級的資料庫。
- 選取 Logs & events (日誌與事件) 索引標籤,然後在 Recent events (最近事件) 中搜尋 PrePatchCompatibility。
- 查看 PrePatchCompatibility 日誌檔,然後解決問題。
**注意:**在大多數情況下,日誌項目包含指向 Amazon RDS for MySQL 文件的連結,說明如何修正不相容的問題。
檢查訊息中的特定錯誤、警告及通知級訊息
在 PrePatchCompatibility 日誌檔中,您可能會收到以下其中一個預檢訊息:
- 「Usage of old temporal type : ERROR」
- 「Usage of db objects with names conflicting with new reserved keywords : WARNING」
- 「Usage of utf8mb3 charset : NOTICE」
- 「Table names in the mysql schema conflicting with new tables in 8.0 : ERROR」
- 「Partitioned tables using engines with non native partitioning : ERROR」
- 「Foreign key constraint names longer than 64 characters : ERROR」
- 「Usage of obsolete MAXDB sql_mode flag : WARNING」
- 「Usage of obsolete sql_mode flags : NOTICE」
- 「ENUM/SET column definitions containing elements longer than 255 characters : ERROR」
- 「Usage of partitioned tables in shared tablespaces : ERROR」
- 「Circular directory references in tablespace data file paths : ERROR」
- 「Usage of removed functions : ERROR」
- 「Usage of removed GROUP BY ASC/DESC syntax : ERROR」
- 「Removed system variables for error logging to the system log configuration : ERROR」
- 「Removed system variables : ERROR」
- 「System variables with new default values : WARNING」
- 「Schema inconsistencies resulting from file removal or corruption : ERROR」
- 「Issues reported by 'check table x for upgrade' command : ERROR or WARNING or NOTICE」
- 「The definer column for mysql.events cannot be null or blank. : ERROR」
- 「Tables with dangling FULLTEXT index reference : ERROR」
- 「Routines with deprecated keywords in definition : ERROR」
- 「DB instance must have enough free disk space : ERROR」
- 「Creating indexes larger than 767 bytes on tables with redundant row format might cause the tables to be inaccessible. : WARNING」
- 「The tables with redundant row format can't have an index larger than 767 bytes. : ERROR」
- 「Column definition mismatch between InnoDB Data Dictionary and actual table definition. : ERROR」
如果您收到 ERROR (錯誤) 訊息,請在嘗試升級前先修正錯誤。如果您收到 WARNING (警告) 訊息,表示 Amazon RDS 未發現嚴重錯誤,但偵測到了一些潛在問題。
如果您收到 NOTICE (通知) 訊息,表示 Amazon RDS 未發現已知的相容性錯誤或問題。不過,仍建議檢查錯誤日誌中的 NOTICE (通知) 訊息。
列出日誌檔並下載資料
若要列出日誌檔並下載資料,請完成以下步驟:
-
執行 describe-db-log-files AWS CLI 命令以列出日誌檔:
aws rds describe-db-log-files --db-instance-identifier DB_identifier --query '*[].[LogFileName]' --output text**注意:**將 DB_identifier 替換為日誌檔所在的資料庫名稱。
輸出範例:[root@ip-x-x-x-x ec2-user]# aws rds describe-db-log-files --db-instance-identifier testinstance --query '*[].[LogFileName]' --output text PrePatchCompatibility.log error/mysql-error.log error/mysql-error-running.log error/mysql-error-running.log.2023-05-06.3 error/mysql-error-running.log.2023-05-09.4 error/mysql-error-running.log.2023-05-10.3 error/mysql-error-running.log.2023-05-12.19 mysqlUpgrade -
執行 download-db-log-file-portion 命令以下載特定日誌檔:
aws rds download-db-log-file-portion --db-instance-identifier DB_identifier \--log-file-name PrePatchCompatibility.log --starting-token 0 \--output text > <LogFileName to save a copy>**注意:**將 DB_identifier 替換為日誌檔所在的資料庫名稱。
輸出範例:aws rds download-db-log-file-portion --db-instance-identifier testinstance \ --log-file-name PrePatchCompatibility.log --starting-token 0 \ --output text > PrePatchCompatibilityCopy.log
相關資訊
MySQL 網站上的準備升級到 MySQL 8.0? 這裡有你需要了解的重要資訊
MySQL 網站上的準備安裝以進行升級
相關內容
- 已提問 1 年前
