Updated on 2024-04-03 GMT+08:00

Changing a Database Port

Scenarios

This section describes how to change the database port of a primary DB instance or a read replica. For primary/standby DB instances, changing the database port of the primary DB instance will cause the database port of the standby DB instance to also be changed.

If specific security group rules have been configured for a DB instance, you need to change the inbound rules of the security group to which the DB instance belongs after changing the database port.

Procedure

  1. Log in to the management console.
  2. Click in the upper left corner and select a region and a project.
  3. Click in the upper left corner of the page and choose Databases > Relational Database Service.
  4. On the Instances page, click the target DB instance or click first and then click the target read replica.
  5. In the Connection Information area on the Basic Information page, click next to the Database Port field.

    Alternatively, choose Connectivity & Security in the navigation pane on the left. In the Connection Information area, click next to the Database Port field.

    • For RDS for SQL Server 2022 Enterprise Edition, 2022 Standard Edition, 2022 Web Edition, 2019 Enterprise Edition, 2019 Standard Edition, 2019 Web Edition, 2017 Enterprise Edition, 2017 Standard Edition, and 2017 Web Edition, the port number can be set to 1433 (default) or 2100 to 9500 (excluding 5050, 5353, 5355, 5985, and 5986).
    • For other editions, the port number can be set to 1433 (default) or 2100 to 9500 (excluding 5355 and 5985).
    • To submit the change, click .
      • In the dialog box, click OK.

        If you have enabled operation protection, click Send Code in the displayed Identity Verification dialog box and enter the obtained verification code. Then, click OK.

        Two-factor authentication improves the security of your account and cloud product. For details about how to enable operation protection, see the Identity and Access Management User Guide.

        1. If you change the database port of the primary DB instance, that of the standby DB instance will also be changed and both DB instances will be rebooted.
        2. If you change the database port of a read replica, the change will not affect other DB instances. Only the read replica will reboot.

          For Microsoft SQL Server, only 2017 Enterprise Edition supports read replicas.

        3. This process takes 1-5 minutes.
      • In the dialog box, click Cancel to cancel the modification.
    • To cancel the change, click .

  6. View the result on the Basic Information page.