After buying a DB instance, you can connect to it using a Windows ECS with MySQL-Front installed over a private network.
MySQL-Front is a Windows front end for MySQL databases. It allows you to interact with MySQL databases through a GUI. For example, you can connect to a database, run SQL commands, and manage tables and records.
Step 1: Buy an RDS for MySQL Instance
Select required basic settings and additional options and buy an RDS for MySQL instance. For details, see section "Buying an RDS for MySQL DB Instance" in Relational Database Service User Guide.
Step 2: Buy an ECS
- Check whether there is a Windows ECS.
- If yes, go to 2.
- If no, purchase an ECS and select Windows as its OS.
To download MySQL-Front to the ECS, bind an EIP to the ECS. The ECS must be in the same region, VPC, and security group as the RDS for MySQL DB instance for mutual communications.
- If there is only a Linux ECS, you can use a MySQL client to connect to the DB instance. For details, see Buying an RDS for MySQL Instance and Connecting to It Using a MySQL Client.
Figure 1 ECS
- Check whether the ECS and RDS for MySQL instance are in the same region and VPC.
- If they are not in the same region, purchase another ECS. The ECS and DB instance in different regions cannot communicate with each other. To reduce network latency, deploy your DB instance in the region nearest to your workloads.
- If the ECS and DB instance are in different VPCs, change the VPC of the ECS to that of the DB instance. For details, see "Changing a VPC" in the Elastic Cloud Server User Guide.
Step 3: Test Connectivity and Install MySQL-Front
- Log in to the ECS. For details, see "Login Using VNC" in the Elastic Cloud Server User Guide.
- On the Instances page of the RDS console, click the DB instance name to go to the Overview page.
- Choose Connectivity & Security from the navigation pane. In the Connection Information area, obtain the floating IP address and database port of the DB instance.
- Open the cmd window on the ECS and check whether the floating IP address and database port of the DB instance can be connected.
telnet 192.168.0.137 3306
- If yes, network connectivity is normal.
- If no, check the security group rules.
- Open a browser, and download and install the MySQL-Front tool on the ECS (version 5.4 is used as an example).
Step 4: Connect to the DB Instance Using MySQL-Front
- Start MySQL-Front.
- In the displayed dialog box, click New.
Figure 2 Connection management
- Enter the information of the DB instance to be connected and click Ok.
Figure 3 Adding an account
Table 1 Parameter description
|
Parameter |
Example Value |
Description |
|
Name |
192.168.0.137 |
Name of the database connection task. If you do not specify this parameter, it will be the same as that configured for Host by default. |
|
Host |
192.168.0.137 |
Floating IP address obtained in 3. |
|
Port |
3306 |
Database port obtained in 3. The default value is 3306. |
|
User |
root |
Name of the user who will access the DB instance. The default user is root. |
|
Password |
- |
Password of the account for accessing the DB instance. |
- In the displayed window, select the connection that you have created in 3 and click Open. If the connection information is correct, the DB instance will be connected.
Figure 4 Opening a session
What Should I Do If I Forget My Password?
On the Instances page, locate the target DB instance, choose More > Reset Password in the Operation column, and set a new password.
Common Connection Error Messages
- [Warning] Access denied for user 'username'@'yourIp' (using password: NO)
If this error message is displayed when you attempt to connect to an RDS for MySQL instance, check whether the username or password is correct.
- [Warning] Access denied for user 'username'@'yourIp' (using password: YES)
If this error message is displayed when you attempt to connect to an RDS for MySQL instance, check whether the username or password is correct.
- ERROR 2013: Lost connection to MySQL server during query
If the values of wait_timeout and interactive_timeout are too small, the RDS for MySQL client will automatically stop connections that timed out.
- ERROR 1045 (28000): Access denied for user 'root'@'192.168.0.30' (using password: YES)
Check whether the password is correct, whether the ECS has the permission to connect to the DB instance, and whether the RDS for MySQL client can ping the DB instance's floating IP address.
- ERROR 1226 (42000): User 'test' has exceeded the 'max_user_connections' resource (current value:10)
Check whether the number of connections to the DB instance is limited.
- ERROR 1129 (HY000): Host '192.168.0.111' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'
Check whether the number of failed connection attempts (not caused by incorrect passwords) of the RDS for MySQL client exceeds the value of max_connection_errors.