All Products
Search
Document Center

Bastionhost:Use the database management feature

Last Updated:Jan 10, 2024

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 RDS instances and self-managed databases

You can import an RDS instance into your bastion host. You can enter information about a self-managed database to import the database into your bastion host. You can also specify a template file to import multiple databases into your bastion host at a time.

Import an RDS instance

You can import an RDS instance that runs MySQL, SQL Server, or PostgreSQL into your bastion host. This way, you can manage the RDS instance in a convenient manner.

  1. Log on to the Bastionhost console. In the top navigation bar, select the region in which your bastion host resides.

  2. In the bastion host list, find the bastion host that you want to manage and click Manage.

  3. In the left-side navigation pane, choose Assets > Database. On the Database page, click Import ApsaraDB RDS Databases.

  4. In the Select Region dialog box, select the region in which the RDS instance to be imported resides.

  5. In the Import ApsaraDB RDS Databases dialog box, select the RDS instance that you want to import and click Import. After the RDS instance is imported, click Completed.

Import a self-managed database

You can enter information about a self-managed database to import the database into your bastion host. You can configure database information to import a single self-managed database.

  1. Log on to the Bastionhost console. In the top navigation bar, select the region in which your bastion host resides.

  2. In the bastion host list, find the bastion host that you want to manage and click Manage.

  3. In the left-side navigation pane, choose Assets > Database. On the Database page, choose Import Databases from Other Sources > Create Database.

  4. 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 self-managed databases by using a template file

You can use a template file to import self-managed databases into 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 into your bastion host.

  1. Log on to the Bastionhost console. In the top navigation bar, select the region in which your bastion host resides.

  2. In the bastion host list, find the bastion host that you want to manage and click Manage.

  3. In the left-side navigation pane, choose Assets > Database. On the Database page, choose Import Databases from Other Sources > Import Databases by Using File.

  4. 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.

    Important

    In 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.

  5. In the Databases to Be Imported dialog box, select the databases that you want to import and click Import.

  6. 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.

  1. Log on to the Bastionhost console. In the top navigation bar, select the region in which your bastion host resides.

  2. In the bastion host list, find the bastion host that you want to manage and click Manage.

  3. In the left-side navigation pane, choose Assets > Database.

  4. On the Database page, find the RDS instance or self-managed database 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 RDS instance or self-managed database in the Database Instance Name column. In the panel that appears, click the Basic Info tab. Then, modify the information about the RDS instance or self-managed database and click Update.

    • Change an O&M address of the RDS instance or self-managed database

      In the database list, select the RDS instance or self-managed database and choose Batch > Database Account. In the dialog box that appears, select a value for Type of Database IP Address and click OK. In the message that appears, click Completed.Change O&M Address

      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 RDS instance or self-managed database 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.

  1. Log on to the console of a bastion host. For more information, see Log on to the console of a bastion host.

  2. In the left-side navigation pane, choose Assets > Database.

  3. On the Database page, find the RDS instance or self-managed 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 RDS instance or self-managed 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 Batch > Database Account > Add Account 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 RDS instance or self-managed database. 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 Batch > Database Account > Delete Account. In the Delete Account dialog box, click OK.

References