Tutorial: Creating a MySQL DB instance with a custom parameter and custom option group - Amazon Relational Database Service

Tutorial: Creating a MySQL DB instance with a custom parameter and custom option group

In this tutorial, you create a MySQL DB instance with a custom parameter and custom option group. For more information about custom parameter and option groups, see Parameter groups for Amazon RDS and Working with option groups .

Introduction

To create DB instances with custom configurations and settings, you can use custom parameter and option groups. Custom parameter and option groups are particularly helpful if you work with multiple databases and want to uniformly configure settings for your fleet.

By completing these steps, you learn:

  • How to use Amazon RDS to create a MySQL DB instances with custom parameter and option groups.

  • How to use specific custom parameters and option for MySQL DB instances.

To complete this tutorial, carry out the following tasks:

  1. Create a custom parameter group with the MySQL parameters default_password_lifetime and disconnect_on_expired_password.

  2. Create a custom option group with MySQL option feature MariaDB Audit Plugin. For steps to create an option group, see Working with option groups.

  3. Create a MySQL DB instances with the custom parameters group and custom option group that you created.

Prerequisites

Before you begin, complete the steps in the following sections:

Create an Amazon RDS custom parameter group;

In this tutorial, you learn how to create a custom parameter group; for a MySQL DB instance in the console. If you don't specify a custom parameter group, Amazon RDS creates DB instances with a default parameter group. The custom parameter group uses default_password_lifetime and disconnect_on_expired_password. The default_password_lifetime parameter determines the length of time until the client password expires. The disconnect_on_expired_password parameter rejects a client connection when the DB instance detects an expired password from the client.. For more information on other custom parameters available for MySQL DB instances, see MySQL documentation.

  1. Open the Amazon RDS console and choose Parameter groups.

  2. In Custom Parameter groups, select Create parameter group.

  3. Set the parameter group details.

    1. Select a name for the parameter group.

    2. Write a description of the parameter group.

    3. In Engine type, select MySQL Community .

    4. In Parameter group family, select MySQL 8.0 .

  4. Select Create.

The new parameter group appears on the Parameter groups page in the Amazon RDS console. The following steps illustrate how to add specific parameters to the parameter group.

Add custom parameters to your custom parameter group

Use the following steps to add specific parameters to the parameter group that you created in Create an Amazon RDS custom parameter group;.

  1. Open the Amazon RDS console and choose Parameter groups.

  2. In Custom parameter groups, select the name of the parameter group you created.

  3. Click Edit.

  4. In the Filter parameters search box, search for the custom parameter Default_password_lifetime.

  5. Select the check box next to the parameter and select Save Changes.

  6. Repeat the same steps for the custom parameter Disconnect_on_expired_password.

The custom parameter group is now available to associate with Amazon RDS for MySQL 8.0 DB instance. Next,create a custom option group for your DB instance.

Create an Amazon RDS custom option group

Create a custom option group with the option MariaDB Audit Plugin. This plugin logs server activity for security and compliance. For more information on other options available for MySQL DB instances, see Options for MySQL DB instances.

  1. Open the Amazon RDS console and choose Option groups.

  2. In Option Groups, select Create group.

  3. Set the Option group details.

    • Select a name for the option group.

    • Write a description of the option group.

    • In Engine type, select mysql.

    • In Major Engine Version, select 8.0.

  4. Select Create.

The new option group appears on the Option groups page in the Amazon RDS console. The following steps illustrate how to add specific options to the option group.

Add options to your custom option group

Use the following steps to add specific options to the option group that you created in Create an Amazon RDS custom option group.

  1. Open the Amazon RDS console and choose Option groups.

  2. In Option groups, select the name of the option group you created.

  3. Under Options, select Add option.

  4. Set the Option group details.

    • In Option name, choose the option MariaDB Audit Plugin, MARIADB_AUDIT_PLUGIN.

    • In Option settings, leave all the default options selected.

    • Check the option Yes to apply immediately.

  5. Choose Create option.

The option should now be available for all associated DB instances. Next, create a MySQL DB instance with the custom parameters and custom option group.

Create a MySQL DB instance with a custom parameter and a custom option group

Finally, create a MySQL DB instance with the custom parameter and option group you made in the steps above. The following steps illustrate how to create the MySQL DB instance with a custom parameter and option group.

  1. Open the Amazon RDS console and choose Databases.

  2. Select Create database.

  3. In Choose a database creation method, select Standard Create.

  4. In Engine options, select MySQL .

  5. In Availability and durability, select Single DB instance. This step is necessary to support a custom parameter or option group.

  6. Select Additional Configuration.

    • In Initial database name, choose a name for your DB instance.

    • Under the DB parameter group dropdown, select the name of the custom parameter group you created previously.

    • Under Option group dropdown, select the name of custom option group you created previously.

  7. For this tutorial, you can leave the default settings for any other DB settings or modify them as your use case requires.

  8. SelectCreate database.

RDS creates a new MySQL DB instance with a custom parameter group and a custom option group. To see more information on this database, see the Databases page of the Amazon RDS console.

In this tutorial, you configure a MySQL DB instance with tailored settings using a custom parameter group and a custom option group. This newly created MySQL DB instance manages the user password lifetime by using the default_password_lifetime parameter. This instance also disconnects users that connect with an expired password by using the disconnect_on_expired_password parameter. You also use the MariaDB Audit Plugin to keep track of server activity. Additional settings can be applied to MySQL DB instance with a customparameter and option group in order to optimize your database.