This topic describes how to change the network type of the read/write splitting address for an RDS for MySQL instance. When you enable the read/write splitting function, you can use the internal or public endpoint of the master instance as the read/write splitting address.

If your application is deployed in the same VPC as the RDS instance, we recommend that you use the internal endpoint to guarantee data security and communication efficiency. If your application is deployed on your computer or in a different network from your RDS instance, you can use the public endpoint to establish a connection.

Prerequisites

  • The read/write splitting function is enabled. For more information, see Enable read/write splitting for an RDS for MySQL instance.
  • The MySQL version and RDS edition are as follows:
    • MySQL 5.7 High-availability Edition (with local SSDs)
    • MySQL 5.6
    Note The read/write splitting function is available in MySQL 8.0 only when the dedicated database proxy service is enabled. However, MySQL 8.0 supports only the VPC network type, therefore you cannot switch to the public endpoint.

Precautions

When you change the network type of the read/write splitting address, the master instance experiences a transient disconnection for up to 30 seconds. To avoid the impact of the transient disconnection, we recommend that you change the network type during off-peak hours and make sure that your application can automatically reconnect to the RDS instance.

Procedure

  1. Log on to the RDS console.
  2. Select the target region.选择地域
  3. Find the target RDS instance and click the instance ID.
  4. In the left-side navigation pane, click Database Connection or Database Proxy.
  5. Click the Read/Write Splitting tab.
  6. Click Switch to Internet Address or Switch to Inner Address.
  7. In the displayed dialog box, click Confirm.切换为外网地址

Reference

FAQ for read/write splitting