

# Amazon RDS での DB パラメータグループの作成
<a name="USER_WorkingWithParamGroups.Creating"></a>

新しい DB パラメータグループは、AWS マネジメントコンソール、AWS CLI、または RDS API を使って作成できます。

DB パラメータグループ名には、次の制限事項が適用されます。
+ 名前は、1～255 の英字、数字、ハイフンである必要があります。

  デフォルトのパラメータグループ名には、`default.mysql8.0` のようなピリオドを含めることができます。ただし、カスタムパラメータグループ名にはピリオドを含めることはできません。
+ 1 字目は文字である必要があります。
+ 名前の最後にハイフンを使用したり、ハイフンを 2 つ続けて使用したりすることはできません。

## コンソール
<a name="USER_WorkingWithParamGroups.Creating.CON"></a>

**DB パラメータグループを作成するには**

1. AWS マネジメントコンソール にサインインし、Amazon RDS コンソール ([https://console.aws.amazon.com/rds/](https://console.aws.amazon.com/rds/)) を開きます。

1. ナビゲーションペインで、**[パラメータグループ]** を選択します。

1. **[パラメータグループの作成]** を選択します。

1. **[パラメータグループ名]** に、新しい DB パラメータグループの名前を入力します。

1. **[説明]** に、新しい DB パラメータグループの説明を入力します。

1. **[エンジンタイプ]** で DB エンジンを選択します。

1. **[パラメータグループファミリー]** で、DB パラメータグループファミリーを選択します。

1. 該当する場合、**[タイプ]** で **[DB パラメータグループ]** を選択します。

1. **[作成]** を選択します。

## AWS CLI
<a name="USER_WorkingWithParamGroups.Creating.CLI"></a>

DB パラメータグループを作成するには、AWS CLI の [https://docs.aws.amazon.com/cli/latest/reference/rds/create-db-parameter-group.html](https://docs.aws.amazon.com/cli/latest/reference/rds/create-db-parameter-group.html) コマンドを使用します。以下の例では、MySQL バージョン 8.0 用に、*mydbparametergroup* という名前で、「*My new parameter group*」という説明の新しい DB パラメータグループを作成しています。

以下の必須パラメータを含めます。
+ `--db-parameter-group-name`
+ `--db-parameter-group-family`
+ `--description`

使用可能なすべてのパラメータグループファミリーを一覧表示するには、次のコマンドを使用します。

```
aws rds describe-db-engine-versions --query "DBEngineVersions[].DBParameterGroupFamily"
```

**注記**  
出力は重複が含まれます。

**Example**  
Linux、macOS、Unix の場合:  

```
aws rds create-db-parameter-group \
    --db-parameter-group-name mydbparametergroup \
    --db-parameter-group-family MySQL8.0 \
    --description "My new parameter group"
```
Windows の場合:  

```
aws rds create-db-parameter-group ^
    --db-parameter-group-name mydbparametergroup ^
    --db-parameter-group-family MySQL8.0 ^
    --description "My new parameter group"
```
このコマンドでは、以下のような出力が生成されます。  

```
DBPARAMETERGROUP  mydbparametergroup  mysql8.0  My new parameter group
```

## RDS API
<a name="USER_WorkingWithParamGroups.Creating.API"></a>

DB パラメータグループを作成するには、RDS API の [https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBParameterGroup.html](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBParameterGroup.html) オペレーションを使用します。

以下の必須パラメータを含めます。
+ `DBParameterGroupName`
+ `DBParameterGroupFamily`
+ `Description`