获取MySQL 5.7升级MySQL 8.0预检查结果
调试
您可以在API Explorer中调试该接口。
接口约束
- 该接口仅支持MySQL引擎。
- 请在调用大版本升级预检查后调用此接口查询具体结果。
- 只有当result_code为0且status为finished状态下,检查才算通过。
- 当报告文件超过8MB将不再展示具体检查信息,请下载报告查看。
URI
- URI格式
GET /v3/{project_id}/instances/{instance_id}/upgrade-version/precheck-result
- 参数说明
表1 参数说明 名称
参数类型
是否必选
说明
project_id
String
是
参数解释:
租户在某一region下的project ID。
获取方法请参见获取项目ID。
约束限制:
不涉及
取值范围:
不涉及
默认取值:
不涉及
instance_id
String
是
参数解释:
实例ID。
约束限制:
不涉及。
取值范围:
不涉及。
默认取值:
不涉及。
请求消息
无。
请求示例
GET https://{Endpoint}/v3/054e292c9880d4992f02c0196d3ea468/instances/d8e6ca5a624745bcb546a227aa3ae1cfin01/upgrade-version/precheck-result
响应消息
- 正常响应要素说明
表2 参数说明 名称
参数类型
说明
result_code
Integer
参数解释:
检查是否通过。
取值范围:
- 0:代表通过。
- 1:代表未通过。
status
String
参数解释:
检查状态。
取值范围:
不涉及。
updated_at
String
参数解释:
检查结果更新时间。
取值范围:
不涉及。
display
Boolean
参数解释:
是否展示数据库检查结果。
取值范围:
- true:展示数据库检查结果。
- false:不展示数据库检查结果。
instance_status_check_list
Array of strings
参数解释:
实例关联关系检查失败项。
取值范围:
不涉及。
db_upgrade_precheck
Object
参数解释:
数据库检查结果,详见表3。
download_link
String
参数解释:
检查结果下载链接。
取值范围:
不涉及。
表3 db_upgrade_precheck字段说明 参数
参数类型
描述
result
Integer
参数解释:
检查是否通过。
取值范围:
- 0:代表通过。
- 1:代表未通过。
checks_performed
Array of objects
参数解释:
检查项,详见表4。
表4 checks_performed字段说明 参数
参数类型
描述
documentation_link
String
参数解释:
检查说明链接。
取值范围:
不涉及。
description
String
参数解释:
检查项描述。
取值范围:
不涉及。
id
String
参数解释:
检查项ID。
取值范围:
不涉及。
title
String
参数解释:
检查项标题。
取值范围:
不涉及。
status
String
参数解释:
检查状态。
取值范围:
不涉及。
detected_problems
Array of objects
参数解释:
各项检查项检测到的问题,详见表5。
- 正常响应样例
{ "status": "finished", "display": true, "result_code": 1, "updated_at": 1744186721503, "instance_status_check_list": [ "readOnly_exists_sql_limit", "related_to_ddm" ], "download_link": "https://dbsbucket-xxxxxxx/xxxxxxxxxxxxxxxxx", "db_upgrade_precheck": { "result": 0, "checks_performed": [ { "description": "Warning: The following objects use the utf8mb3 character set. It is recommended to convert them to use utf8mb4 instead, for improved Unicode support.", "id": "utf8mb3Check", "title": "Usage of utf8mb3 charset", "status": "OK", "documentation_link": "https://dev.mysql.com/doc/refman/8.0/en/charset-unicode-utf8mb3.html", "detected_problems": [ { "level": "Warning", "description": "schema's default character set: utf8", "db_object": "mysql" } ] }, { "description": "Warning: Following system variables that were detected as being used will be removed. Please update your system to not rely on them before the upgrade.", "id": "removedSysVars", "title": "Removed system variables", "status": "OK", "documentation_link": "https://dev.mysql.com/doc/refman/8.0/en/added-deprecated-removed.html#optvars-removed", "detected_problems": [ { "level": "Warning", "description": "is set and will be removed", "db_object": "innodb_file_format_max" }, { "level": "Warning", "description": "is set and will be removed", "db_object": "query_cache_size" } ] }, { "description": "Warning: Following system variables that are not defined in your configuration file will have new default values. Please review if you rely on their current values and if so define them before performing upgrade.", "id": "sysVarsNewDefaults", "title": "System variables with new default values", "status": "OK", "documentation_link": "https://mysqlserverteam.com/new-defaults-in-mysql-8-0/", "detected_problems": [ { "level": "Warning", "description": "default value will change from latin1_swedish_ci to utf8mb4_0900_ai_ci", "db_object": "collation_server" }, { "level": "Warning", "description": "default value will change from OFF to ON", "db_object": "event_scheduler" }, { "level": "Warning", "description": "default value will change from 75 (%) 90 (%)", "db_object": "innodb_max_dirty_pages_pct" }, { "level": "Warning", "description": "default value will change from_0 (%) to 10 (%)", "db_object": "innodb_max_dirty_pages_pct_lwm" }, { "level": "Warning", "description": "default value will change from 0 to 2", "db_object": "innodb_undo_tablespaces" }, { "level": "Warning", "description": "default value will change from 3 (Notes) to 2 (Warning)", "db_object": "log_error_verbosity" }, { "level": "Warning", "description": "default value will change from 64 to 1024", "db_object": "max_error_count" }, { "level": "Warning", "description": "default value will change from 16KB to 1MB", "db_object": "optimizer_trace_max_mem_size" }, { "level": "Warning", "description": "default value will change from OFF to ON", "db_object": "performance_schema_consumer_events_transactions_current" }, { "level": "Warning", "description": "default value will change from OFF to ON", "db_object": "performance_schema_consumer_events_transactions_history" }, { "level": "Warning", "description": "default value will change from 'INDEX_SCAN, TABLE_SCAN' to 'INDEX_SCAN, HASH_SCAN'", "db_object": "slave_rows_search_algorithms" }, { "level": "Warning", "description": "default value will change from 2000 to 4000", "db_object": "table_open_cache" } ] }, { "description": "Warning: By default zero date/datetime/timestamp values are no longer allowed in MySQL, as of 5.7.8 NO_ZERO_IN_DATE and NO_ZERO_DATE are included in SQL_MODE by default. These modes should be used with strict mode as they will be merged with strict mode in a future release. If you do not include these modes in your SQL_MODE setting, you are able to insert date/datetime/timestamp values that contain zeros. It is strongly advised to replace zero values with valid ones, as they may not work correctly in the future.", "id": "zeroDatesCheck", "title": "Zero Date, Datetime, and Timestamp values", "status": "OK", "documentation_link": "https://lefred.be/content/mysql-8-0-and-wrong-dates/", "detected_problems": [ { "level": "Warning", "description": "does not contain either NO_ZERO_DATE or NO_ZERO_IN_DATE which allows insertion of zero dates", "db_object": "global.sql_mode" } ] } ] } }
- 异常响应
请参见异常请求结果。
状态码
- 正常
- 异常
请参见状态码。
错误码
请参见错误码。