DBS allows you to add multiple data sources of the same type, which facilitates management and backup. This topic describes how to add multiple data sources at a time.
- The batch import feature is available only for self-managed MySQL databases that are deployed over the Internet.
- You are not charged when you add a data source. You are charged if you enable backup for the added data source. For more information about how to enable backup, see Back up one or more databases.
- Log on to the DBS console.
- In the left-side navigation pane, click Data Source. On the Data Source page, select a region in the upper-left corner.
- Select Batch import from the Data source category drop-down list.
- In the Batch data source field, enter multiple data sources.
Enter a data source in the following format:
$instanceName,$host,$port,region,MySQL,$account,$password. Press the Enter key to move to a new line.Example:
The following table describes the parameters.
The name of the data source.Note We recommend that you set a descriptive name that makes it easy to identify.
The IP address that is used to connect to the specified database.
The port number that is used to connect to the specified database.
The region in which to create the backup schedule.Note You must select the region that you selected in Step 2. If you set this parameter to cn-hangzhou, the backup schedule of the database is created in the China (Hangzhou) region.
The database engine. Set this parameter to MySQL.
The database account.Note
- The account is used to log on to the database that is used as the data source. The account must have the required permissions. For more information, see Database permissions.
- After you add a data source and configure a database account and password, you can change the database account and password in the DBS console. For more information, see Configure the account and password for a data source.
The password for the account.
- Click Test Connection.Note
- If the configured database account and password are valid, a message appears, which indicates that the connection is successful.
- If the configured database account and password are invalid, a message appears, indicating that the connection fails. You can click Check to view the cause of failure.
- Click OK.
You can view the added data sources on the Data Source page.