You can import databases into a bastion host and perform O&M and audit operations on the databases by using the bastion host. The databases include ApsaraDB RDS for MySQL, ApsaraDB RDS for SQL Server, and ApsaraDB RDS for PostgreSQL instances, PolarDB for MySQL, PolarDB for PostgreSQL, and PolarDB for PostgreSQL (Compatible with Oracle) clusters, and self-managed MySQL, SQL Server, PostgreSQL, and Oracle databases. This topic describes how to import and manage RDS instances and self-managed databases, and manage database accounts.
Import the databases within the current Alibaba Cloud account
Import ApsaraDB RDS instances
You can import ApsaraDB RDS for MySQL instances, ApsaraDB RDS for SQL Server instances, and ApsaraDB RDS for PostgreSQL instances within the current Alibaba Cloud account to your bastion host for convenient O&M.
Log on to the Bastionhost console. In the top navigation bar, select the region in which your bastion host resides.
In the bastion host list, find the bastion host that you want to manage and click Manage.
In the left-side navigation pane, choose .
On the Database page, choose
.In the Select Region dialog box, select the region of the ApsaraDB RDS instances that you want to import and click OK.
In the Import ApsaraDB RDS Databases dialog box, select the ApsaraDB RDS instances that you want to import and click Import.
Import PolarDB clusters
You can import PolarDB for MySQL clusters, PolarDB for PostgreSQL clusters, and PolarDB for PostgreSQL (Compatible with Oracle) clusters within the current Alibaba Cloud account to your bastion host for convenient O&M.
Log on to the Bastionhost console. In the top navigation bar, select the region in which your bastion host resides.
In the bastion host list, find the bastion host that you want to manage and click Manage.
In the left-side navigation pane, choose .
On the Database page, choose
.In the Select Region dialog box, select the region of the PolarDB clusters that you want to import and click OK.
In the Import PolarDB for Xscale Database dialog box, select the PolarDB clusters that you want to import and click Import.
Import the databases of members
Bastionhost allows you to manage the assets within multiple accounts in a centralized manner. If you have multiple Alibaba Cloud accounts, you can perform centralized O&M operations on the assets within these accounts by using a bastion host based on Resource Directory. To import the databases of a member to your bastion host, you must add the member to the bastion host first. For more information, see Multi-account management.
Import ApsaraDB RDS instances
You can import ApsaraDB RDS for MySQL instances, ApsaraDB RDS for SQL Server instances, and ApsaraDB RDS for PostgreSQL instances within multiple Alibaba Cloud accounts to your bastion host for convenient O&M.
Log on to the Bastionhost console. In the top navigation bar, select the region in which your bastion host resides.
In the bastion host list, find the bastion host that you want to manage and click Manage.
In the left-side navigation pane, choose .
On the Database page, choose
.In the Select Alibaba Cloud Account step, select an Alibaba Cloud account whose databases you want to import and click Next.
In the Select Region step, select the region of the ApsaraDB RDS instances that you want to import and click OK.
In the Import ApsaraDB RDS Databases dialog box, select the ApsaraDB RDS instances that you want to import and click Import.
Import PolarDB clusters
You can import PolarDB for MySQL clusters, PolarDB for PostgreSQL clusters, and PolarDB for PostgreSQL (Compatible with Oracle) clusters within multiple Alibaba Cloud accounts to your bastion host for convenient O&M.
Log on to the Bastionhost console. In the top navigation bar, select the region in which your bastion host resides.
In the bastion host list, find the bastion host that you want to manage and click Manage.
In the left-side navigation pane, choose .
On the Database page, choose
.In the Select Alibaba Cloud Account step, select an Alibaba Cloud account whose databases you want to import and click Next.
In the Select Region step, select the region of the PolarDB clusters that you want to import and click OK.
In the Import PolarDB for Xscale Database dialog box, select the PolarDB clusters that you want to import and click Import.
Import databases from other sources
Import self-managed databases
You can enter the information about a self-managed database to import the database to your bastion host. You can configure database information to import a single self-managed database.
Log on to the Bastionhost console. In the top navigation bar, select the region in which your bastion host resides.
In the bastion host list, find the bastion host that you want to manage and click Manage.
In the left-side navigation pane, choose . On the Database page, choose .
In the Create Database panel, configure the Database Instance Name, Protocol, Database Address, and Service Port parameters. Then, click Create.
After the database is created, you can click Add Account to create a database account for the database. You can also click Back to List to view the database in the database list.
Import databases by using a template file
You can use a template file to import databases to your bastion host. Bastionhost provides template files in the XLS, CSV, and XLSX formats. You can select a template file, enter the information about the databases that you want to import in the file, and then upload the file to import the databases to your bastion host.
Log on to the Bastionhost console. In the top navigation bar, select the region in which your bastion host resides.
In the bastion host list, find the bastion host that you want to manage and click Manage.
In the left-side navigation pane, choose . On the Database page, choose .
In the Import Database panel, click Download Database Template. After the template package is downloaded, decompress the package, open the Excel template file, and then enter information about the databases based on the requirements of the template file. Then, save the changes to the file. Click Upload to upload the Excel file.
ImportantIn a template file, you must specify the Database Address field. If you set the Protocol field to PostgreSQL for a database, you must also specify the Database (PostgreSQL) field. If you do not specify a required field, the bastion host does not import the database.
In the Databases to Be Imported dialog box, select the databases that you want to import and click Import.
In the Import Database panel, click Import Database.
The databases that you want to import are displayed in a table. If some databases have the same name, the bastion host imports only the last database of the same name in the table. For example, if the first database, the third database, and the fifth database have the same name, only the fifth database is imported. If a database that you want to import has the same name as an existing database in the bastion host, the bastion host does not import the database. You can click Details in the Import Database panel to view the information about the databases that are not imported.
Manage RDS instances or self-managed databases
After you import an RDS instance or self-managed database, you can manage the RDS instance or self-managed database based on your business requirements. For example, you can modify the information about or O&M address of the RDS instance or self-managed database. You can also delete the RDS instances or self-managed databases that are no longer in use.
Log on to the Bastionhost console. In the top navigation bar, select the region in which your bastion host resides.
In the bastion host list, find the bastion host that you want to manage and click Manage.
In the left-side navigation pane, choose .
On the Database page, find the database instance that you want to manage and perform the following operations based on your business requirements:
Modify the information about the RDS instance or self-managed database
In the database list, click the name of the database instance in the Database Instance Name column. In the panel that appears, click the Basic Info tab. Then, modify the information about the database instance and click Update.
Change an O&M address of the RDS instance or self-managed database
In the database list, select the database instances that you want to manage and choose
. In the dialog box that appears, select a value for Type of Database IP Address, click OK, and then click Completed.Valid values of the Type of Database IP Address parameter: Internal Endpoint and Public Endpoint.
Remove the RDS instance or self-managed database
In the database list, select the database instances that you want to remove from the bastion host and click Delete. In the message that appears, click Delete.
Manage database accounts
After you import an RDS instance or a self-managed database, you can create a database account for the RDS instance or self-managed database. After the database account is created, O&M personnel can use the database account to log on to the self-managed database or a database of the RDS instance and perform O&M operations. You can also manage the database account. For example, you can manage the password of the database account, change the username of the database account, or delete the database account. This facilitates O&M.
Log on to the console of a bastion host. For more information, see Log on to the console of a bastion host.
In the left-side navigation pane, choose .
On the Database page, find the database for which you want to create a database account, modify the information about a database account, or delete a database account. Then, perform the following operations based on your business requirements:
Create a database account
Find the database and click Add Database Account in the Actions column. In the Add Database Account panel, configure the Logon Name and Password parameters and click Create.
Create multiple database accounts at a time
Select multiple databases and choose
below the list. In the Add Account dialog box, configure the parameters and click Create.Manage database accounts
Click the digit in the Database Accounts column of the database that you want to manage. In the panel that appears, click the Database Account tab. Then, perform the following operations based on your business requirements:
Manage the password of a database account
In the Password column of a database account, click Set or Clear to configure a password for the database account or delete the existing password from the database account.
Change the username of a database account
Click the username in the Logon Name column of a database account. In the Modify Database Account panel, change the username of the database account and click Update.
Delete a database account
Select the database account that you want to delete and click Delete. In the message that appears, click Delete.
Delete multiple database accounts at a time
Select the database accounts that you want to delete and click
. In the Delete Account dialog box, click OK.
References
For more information about the O&M operations on databases, see O&M overview.