Updated on 2024-07-15 GMT+08:00

Creating an RDS for MySQL Instance

Create an RDS for MySQL instance and construct test data.

Creating an Instance

  1. Log in to the management console.
  2. Click in the upper left corner of the management console and select AP-Singapore.
  3. Under the service list, choose Databases > Relational Database Service.
  4. Click Buy DB Instance.
  5. Configure the instance name and basic information.

  6. Configure instance specifications.

  7. Select a VPC and security group for the instance and configure the database port.

    The VPC and security group have been created in Creating a VPC and Security Group.

  8. Configure the instance password.

  9. Click Next.
  10. Confirm your settings.

    • To modify your settings, click Previous.
    • If you do not need to modify your settings, click Submit.

  11. Return to the instance list.

    If the instance status becomes available, the instance has been created.

Generating Test Data

  1. Log in to the management console.
  2. Click in the upper left corner of the management console and select AP-Singapore.
  3. Under the service list, choose Databases > Relational Database Service.
  4. Select an RDS instance and choose More > Log In.
  5. In the dialog box that is displayed, enter the username and password of the instance and click Test Connection.
  6. After the connection is successful, click Log In to log in to the RDS instance.
  7. Click Create Database to create the db_test database.

  8. Run the following statements in db_test to create table table3_:

    CREATE TABLE `db_test`.`table3_` (
    	`Column1` INT(11) UNSIGNED NOT NULL,
    	`Column2` TIME NULL,
    	`Column3` CHAR NULL,
    	PRIMARY KEY (`Column1`)
    )	ENGINE = InnoDB
    	DEFAULT CHARACTER SET = utf8mb4
    	COLLATE = utf8mb4_general_ci;

  9. Run the following statements in table table3_ to insert three lines of data:

    INSERT INTO `db_test`.`table3_` (`Column1`,`Column2`,`Column3`) VALUES(1,'00:00:11','a');
    INSERT INTO `db_test`.`table3_` (`Column1`,`Column2`,`Column3`) VALUES(2,'00:00:22','b');
    INSERT INTO `db_test`.`table3_` (`Column1`,`Column2`,`Column3`) VALUES(5,'00:00:55','e');