

# MariaDB 的参数
MariaDB 的参数

默认情况下，MariaDB 数据库实例使用特定于 MariaDB 数据库的数据库参数组。该参数组包含 MySQL 数据库引擎的 Amazon RDS 数据库参数组中所含的部分而非全部参数。它还包含一些新的特定于 MariaDB 的参数。有关使用参数组和设置参数的信息，请参阅[Amazon RDS 的参数组](USER_WorkingWithParamGroups.md)。

## 查看 MariaDB 参数


RDS for MariaDB 参数设置为您已选择的存储引擎的默认值。有关 MariaDB 参数的更多信息，请参阅 [MariaDB 文档](http://mariadb.com/kb/en/mariadb/documentation/)。有关 MariaDB 存储引擎的更多信息，请参阅 [Amazon RDS 上的 MariaDB 支持的存储引擎](MariaDB.Concepts.Storage.md)。

您可以使用 RDS 控制台或 Amazon CLI 查看特定 RDS for MariaDB 版本的可用参数。有关在 RDS 控制台中查看 MariaDB 参数组中参数的信息，请参阅 [在 Amazon RDS 中查看数据库参数组的参数值](USER_WorkingWithParamGroups.Viewing.md)。

使用 Amazon CLI，您可以通过运行 [https://docs.amazonaws.cn/cli/latest/reference/rds/describe-engine-default-parameters.html](https://docs.amazonaws.cn/cli/latest/reference/rds/describe-engine-default-parameters.html) 命令查看 RDS for MariaDB 版本的参数。为 `--db-parameter-group-family` 选项指定下列值之一：
+ `mariadb11.8`
+ `mariadb11.4`
+ `mariadb10.11`
+ `mariadb10.6`
+ `mariadb10.5`
+ `mariadb10.4`
+ `mariadb10.3`

例如，要查看 RDS for MariaDB 版本 10.6 的参数，请运行以下命令。

```
aws rds describe-engine-default-parameters --db-parameter-group-family mariadb10.6
```

输出看上去类似于以下内容。

```
{
    "EngineDefaults": {
        "Parameters": [
            {
                "ParameterName": "alter_algorithm",
                "Description": "Specify the alter table algorithm.",
                "Source": "engine-default",
                "ApplyType": "dynamic",
                "DataType": "string",
                "AllowedValues": "DEFAULT,COPY,INPLACE,NOCOPY,INSTANT",
                "IsModifiable": true
            },
            {
                "ParameterName": "analyze_sample_percentage",
                "Description": "Percentage of rows from the table ANALYZE TABLE will sample to collect table statistics.",
                "Source": "engine-default",
                "ApplyType": "dynamic",
                "DataType": "float",
                "AllowedValues": "0-100",
                "IsModifiable": true
            },
            {
                "ParameterName": "aria_block_size",
                "Description": "Block size to be used for Aria index pages.",
                "Source": "engine-default",
                "ApplyType": "static",
                "DataType": "integer",
                "AllowedValues": "1024-32768",
                "IsModifiable": false
            },
            {
                "ParameterName": "aria_checkpoint_interval",
                "Description": "Interval in seconds between automatic checkpoints.",
                "Source": "engine-default",
                "ApplyType": "dynamic",
                "DataType": "integer",
                "AllowedValues": "0-4294967295",
                "IsModifiable": true
            },
        ...
```

要仅列出 RDS for MariaDB 版本 10.6 的可修改参数，请运行以下命令。

对于 Linux、macOS 或 Unix：

```
aws rds describe-engine-default-parameters --db-parameter-group-family mariadb10.6 \
   --query 'EngineDefaults.Parameters[?IsModifiable==`true`]'
```

对于：Windows

```
aws rds describe-engine-default-parameters --db-parameter-group-family mariadb10.6 ^
   --query "EngineDefaults.Parameters[?IsModifiable==`true`]"
```

## 不提供的 MariaDB 参数


以下 MySQL 参数在 MariaDB 特定的数据库参数组中不可用：
+ bind\$1address
+ binlog\$1error\$1action
+ binlog\$1gtid\$1simple\$1recovery
+ binlog\$1max\$1flush\$1queue\$1time
+ binlog\$1order\$1commits
+ binlog\$1row\$1image
+ binlog\$1rows\$1query\$1log\$1events
+ binlogging\$1impossible\$1mode
+ block\$1encryption\$1mode
+ core\$1file
+ default\$1tmp\$1storage\$1engine
+ div\$1precision\$1increment
+ end\$1markers\$1in\$1json
+ enforce\$1gtid\$1consistency
+ eq\$1range\$1index\$1dive\$1limit
+ explicit\$1defaults\$1for\$1timestamp
+ gtid\$1executed
+ gtid-mode
+ gtid\$1next
+ gtid\$1owned
+ gtid\$1purged
+ log\$1bin\$1basename
+ log\$1bin\$1index
+ log\$1bin\$1use\$1v1\$1row\$1events
+ log\$1slow\$1admin\$1statements
+ log\$1slow\$1slave\$1statements
+ log\$1throttle\$1queries\$1not\$1using\$1indexes
+ master-info-repository
+ optimizer\$1trace
+ optimizer\$1trace\$1features
+ optimizer\$1trace\$1limit
+ optimizer\$1trace\$1max\$1mem\$1size
+ optimizer\$1trace\$1offset
+ relay\$1log\$1info\$1repository
+ rpl\$1stop\$1slave\$1timeout
+ slave\$1parallel\$1workers
+ slave\$1pending\$1jobs\$1size\$1max
+ slave\$1rows\$1search\$1algorithms
+ storage\$1engine
+ table\$1open\$1cache\$1instances
+ timed\$1mutexes
+ transaction\$1allow\$1batching
+ validate-password
+ validate\$1password\$1dictionary\$1file
+ validate\$1password\$1length
+ validate\$1password\$1mixed\$1case\$1count
+ validate\$1password\$1number\$1count
+ validate\$1password\$1policy
+ validate\$1password\$1special\$1char\$1count

有关 MySQL 参数的更多信息，请参阅 [MySQL 文档](https://dev.mysql.com/doc/refman/8.0/en/)。