本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
My 的參數SQL
根據預設,MySQL 資料庫執行個體會使用 MySQL 資料庫專屬的資料庫參數群組。此參數群組包含 MySQL 資料庫引擎的參數。如需使用參數群組和設定參數的相關資訊,請參閱Amazon RDS 的參數群組。
RDS for MySQL 參數會設定為您已選取的儲存引擎的預設值。如需有關我的SQL參數的詳細資訊,請參閱我的SQL文件
您可以使用 RDS主控台或 檢視適用於 My RDS SQL 版本的特定可用參數 AWS CLI。如需在 RDS 主控台中檢視 MySQL 參數群組中參數的詳細資訊,請參閱 檢視 Amazon RDS Amazon 中資料庫參數群組的參數值。
使用 AWS CLI,您可以執行 describe-engine-default-parameters
命令來檢視 RDS for MySQL 版本的參數。為 --db-parameter-group-family
選項指定下列其中一個值:
-
mysql8.4
-
mysql8.0
-
mysql5.7
例如,若要檢視 MySQL 8.0 版RDS的 參數,請執行下列命令。
aws rds describe-engine-default-parameters --db-parameter-group-family mysql8.0
您的輸出結果類似以下內容。
{
"EngineDefaults": {
"Parameters": [
{
"ParameterName": "activate_all_roles_on_login",
"ParameterValue": "0",
"Description": "Automatically set all granted roles as active after the user has authenticated successfully.",
"Source": "engine-default",
"ApplyType": "dynamic",
"DataType": "boolean",
"AllowedValues": "0,1",
"IsModifiable": true
},
{
"ParameterName": "allow-suspicious-udfs",
"Description": "Controls whether user-defined functions that have only an xxx symbol for the main function can be loaded",
"Source": "engine-default",
"ApplyType": "static",
"DataType": "boolean",
"AllowedValues": "0,1",
"IsModifiable": false
},
{
"ParameterName": "auto_generate_certs",
"Description": "Controls whether the server autogenerates SSL key and certificate files in the data directory, if they do not already exist.",
"Source": "engine-default",
"ApplyType": "static",
"DataType": "boolean",
"AllowedValues": "0,1",
"IsModifiable": false
},
...
若要僅列出適用於 MySQL 8.0 版RDS的可修改參數,請執行下列命令。
用於 Linux, macOS、 或 Unix:
aws rds describe-engine-default-parameters --db-parameter-group-family mysql8.0 \ --query 'EngineDefaults.Parameters[?IsModifiable==`true`]'
用於 Windows:
aws rds describe-engine-default-parameters --db-parameter-group-family mysql8.0 ^ --query "EngineDefaults.Parameters[?IsModifiable==`true`]"