Before you can manage a database instance in Data Management (DMS), you must either register the instance with DMS or log on to it directly. This topic covers three scenarios: switching from a database console to DMS, registering a new instance, and reconnecting to a disconnected instance.
Important notes
-
Create a dedicated database account for DMS. Do not reuse accounts shared with other services.
-
Enable security hosting for the instance. Without security hosting, you must enter your database account and password every time you log on.
-
Do not add leading or trailing spaces or other special characters to instance information when registering an instance.
-
If you are logging on to a PolarDB for MySQL cluster during or after a major version upgrade:
-
Wait until the upgrade completes before logging on.
-
After the upgrade, manually update the instance information in DMS to sync the instance name, then update the data dictionary to refresh the instance endpoint and name. See Modify database instances and Synchronize the data dictionary of a database instance.
-
-
When logging on to an ApsaraDB for MongoDB instance, enter the account and password exactly as configured in the ApsaraDB for MongoDB console. Special characters in the password do not need to be escaped.
Logon methods
| Instance status | Instance type | Logon method |
|---|---|---|
| New instance (never logged on from DMS) | Alibaba Cloud database instance | (Recommended) Switch from the database console to DMS |
| New instance | Alibaba Cloud, third-party cloud, or self-managed | Register the instance |
| Existing instance | Any | Log on to a disconnected instance |
Switch from the database console to DMS
This method is recommended for Alibaba Cloud database instances. The following steps use ApsaraDB RDS for MySQL as an example.
-
Log on to the ApsaraDB RDS console. In the left-side navigation pane, click Instances, then click the instance ID of the instance you want to manage.
-
In the left-side navigation pane, click Accounts to view the accounts for the instance.
If you have forgotten the account password, click Reset Password in the Actions column. See Reset the password of an account on an ApsaraDB RDS for MySQL instance.
-
At the top of the instance details page, click Log On to Database. The DMS console opens and the Log on to Database Instance dialog box appears.
-
Enter the Database Account and Database Password.
The Database Account field takes a username, not a database name.
-
Click Login.
If you enabled security hosting, your credentials are saved securely and you will not need to enter them again the next time you log on to this instance.
Register a database instance
Log on to a disconnected instance
In Flexible Management mode, a registered instance disconnects from DMS 24 hours after you log on to the database instance. To reconnect, follow these steps.
-
Log on to the DMS console V5.0.
-
In the left-side navigation pane, click Instances Disconnected, find the instance you want to connect to, and right-click it.
Instances are grouped into three sections in the navigation pane: Logon-free Instances, Instances Connected, and Instances Disconnected.
-
Select Login Instance. In the Login Instance dialog box, enter the Database Account and Database Password.
The Database Account field takes a username, not a database name.
-
Click OK.
The SQL Console tab opens. You can now run queries and manage the instance.
What to do next
After logging on to a database instance in DMS, you can:
-
Manage databases: create databases, create tables, and query or modify data. See Manage a database on the SQLConsole tab.
-
Modify large amounts of data without locking tables. See Perform lock-free DML operations.
-
Export table data. See Export data.
-
Troubleshoot logon failures. See FAQ about database logon.
FAQ
Q: A whitelist error appears when I register an Alibaba Cloud database instance in DMS. What do I do?
Click Configure Whitelist in the message. DMS automatically adds the required IP addresses and CIDR blocks to the whitelist. If the automatic addition fails, add them manually. See Add DMS IP addresses and CIDR blocks to security settings.
Q: Does DMS support Flexible Management mode?
Yes. If you do not select Stable Change mode or Security Collaboration mode when registering an instance, DMS uses Flexible Management mode by default.
Q: I enabled Secure Sockets Layer (SSL) or Transport Layer Security (TLS) encryption on an ApsaraDB for Redis instance, but I get an error when logging on in DMS. What do I do?
Enable SSL for the instance within DMS itself:
-
Log on to the DMS console V5.0.
-
In the left-side navigation pane, choose Database Instances > Instances Disconnected. Right-click the ApsaraDB for Redis instance and click Edit.
-
In the Advanced Information section, set Enable SSL to Enable.
-
Click Test Connection.
-
After the connection test passes, click Save.
See Modify database instances for more details.
Q: The DMS server IP addresses are added to the Azure SQL Database firewall, but I still get an error when registering the instance. What do I do?
Enter the database account in database account@Server name format in the Add Instance dialog box. For example, if the public endpoint is testservername.testdatabase.windows.net and the account is testuser, enter testuser@testservername.
Q: How do I grant the correct permissions to the database account used to log on to DMS?
The required permissions depend on what you need to manage:
-
To manage all databases on an instance, the account needs permissions on all databases.
-
To manage specific databases, the account needs permissions on those databases.
-
To add, delete, modify, and query data and modify table schemas, the account needs both Data Manipulation Language (DML) and Data Definition Language (DDL) permissions.
-
To work with views, stored procedures, triggers, and functions, the account needs permissions on those objects.
The exact SQL statements for granting permissions vary by database type. Refer to the official documentation for your database.
Q: How do I log on to an instance that has been deleted from the DMS instance list?
Make sure the database instance is running. In the DMS console, go to the Instance List tab, find the instance, and choose More > Login Instance in the Actions column. Enter the database account and password, then click Save. See Modify database instances.