Instance Connection Guide
| | | |
| | | |
| | | |
|[pic] | |
| |Relational Database Service |[pic] | |
| | | | |
| |Instance Connection Guide | | |
| | | | |
| |Issue |01 | | |
| |Date |2017-10-16 | | |
| |HUAWEI TECHNOLOGIES CO., LTD. | | |
|Copyright © Huawei Technologies Co., Ltd. 2017. All rights reserved. |
|No part of this document may be reproduced or transmitted in any form or by any means without prior written consent of Huawei Technologies Co.,|
|Ltd. |
| |
|Trademarks and Permissions |
|[pic] and other Huawei trademarks are trademarks of Huawei Technologies Co., Ltd. |
|All other trademarks and trade names mentioned in this document are the property of their respective holders. |
| |
|Notice |
|The purchased products, services and features are stipulated by the contract made between Huawei and the customer. All or part of the products,|
|services and features described in this document may not be within the purchase scope or the usage scope. Unless otherwise specified in the |
|contract, all statements, information, and recommendations in this document are provided "AS IS" without warranties, guarantees or |
|representations of any kind, either express or implied. |
|The information in this document is subject to change without notice. Every effort has been made in the preparation of this document to ensure |
|accuracy of the contents, but all statements, information, and recommendations in this document do not constitute a warranty of any kind, |
|express or implied. |
|Huawei Technologies Co., Ltd. |
|Address: |Huawei Industrial Base |
| |Bantian, Longgang |
| |Shenzhen 518129 |
| |People's Republic of China |
|Website: | |
| | |
Contents
1 Getting Started 1
1.1 Connecting to an RDS DB Instance 1
1.1.1 Connecting to an RDS MySQL Instance 1
1.1.2 Connecting to an RDS PostgreSQL Instance 3
1.1.3 Connecting to an RDS Microsoft SQL Server DB Instance 4
Getting Started
1 Connecting to an RDS DB Instance
You can access RDS through an ECS. You can use the database client on the ECS to maintain RDS DB instances.
When creating a DB instance, RDS creates an SSL server certificate for the DB instance. The SSL certificate includes the DB instance IP address as the Common Name (CN) for the SSL certificate to guard against spoofing attacks. You are advised to use SSL to encrypt connections from applications a DB instance.
1 Connecting to an RDS MySQL Instance
You can use a MySQL client to connect to a DB instance through a common or an SSL connection. The SSL connection is encrypted and more secure.
. Preparations
1. Prepare an ECS.
To connect to a DB instance through an ECS, create an ECS first.
For details on how to create and connect to an ECS, see How Can I Create and Connect to an ECS?
2. Install the MySQL client on the ECS prepared in 1.
For details, see How Can I Install the MySQL Client?
. Common Connection
1. Log in to the ECS.
1. Run the following command to connect to an RDS DB instance:
mysql -h -P 8635 -u -p
[pic]
• -h indicates the IP address of the primary DB instance. To obtain the IP address, go to the Instance Mgmt page, locate the target primary DB instance in the DB instance list area, and view the IP address in the Connection Address column.
• -P indicates the database port in use. The default value is 8635. To obtain the database port, go to the Instance Mgmt page, locate the target primary DB instance in the DB instance list area, and view the port in the Connection Address column.
• -u indicates the user name, that is, the RDS database account. (The default administrator account is root.)
• -p indicates the password of the database account.
For example, run the following command as user root to connect to a DB instance:
mysql -h 172.16.0.31 -P 8635 -u root -pRDSpwd@4321
----End
. SSL Connection
1. On the Instance Mgmt page, click here to go to the Developer Tool Center page and download the root certificate and certificate bundle.
1. Downloading the root certificate
[pic]
[pic]
• In April 2017, RDS provides a new root certificate that has a 20-year validation period. The new certificate takes effect after DB instances are rebooted. Update the old certificate before it expires. For details, see How Can I Identify the Validity Period of the SSL Root Certificate?
• You can also download the certificate bundle, containing both the new certificate provided in April and the old certificate.
1. Upload the root certificate to the ECS to be connecting to the MySQL DB instance.
2. Connect to an RDS DB instance. In Linux, for example, run the following command:
mysql -h -P8635 -u -p --ssl-ca=
[pic]
• -h indicates the IP address of the primary DB instance. To obtain the IP address, go to the Instance Mgmt page, locate the target primary DB instance in the DB instance list area, and view the IP address in the Connection Address column.
• -P indicates the database port in use. The default value is 8635. To obtain the database port, go to the Instance Mgmt page, locate the target primary DB instance in the DB instance list area, and view the port in the Connection Address column.
• -u indicates the user name, that is, the RDS database account. (The default administrator account is root.)
• -p indicates the password of the database account.
• --ssl-ca indicates the SSL certificate file name. The SSL certificate file should be stored in the directory where the command executes.
Use user root to connect to a DB instance through an SSL connection. An example is as follows:
mysql -h172.16.0.31 -P8635 -uroot -p --ssl-ca=ca.pem
----End
2 Connecting to an RDS PostgreSQL Instance
You can use a PostgreSQL client to connect to a DB instance through a common or an SSL connection. The SSL connection is encrypted and more secure.
. Preparations
1. Prepare an ECS.
To connect to a DB instance through an ECS, create an ECS first.
For details on how to create and connect to an ECS, see How Can I Create and Connect to an ECS?
2. Install the PostgreSQL client on the ECS prepared in 1.
For details, see How Can I Install the PostgreSQL Client?
. Common Connection
1. Log in to the ECS.
1. Run the following command to connect to an RDS DB instance:
psql --no-readline -U -h -p -d -W
[pic]
• -U indicates the user name, that is, the RDS database account. (The default administrator account is root.)
• -h indicates the IP address of the primary DB instance. To obtain the IP address, go to the Instance Mgmt page, locate the target primary DB instance in the DB instance list area, and view the IP address in the Connection Address column.
• -p indicates the database port in use. The default value is 8635. To obtain the database port, go to the Instance Mgmt page, locate the target primary DB instance in the DB instance list area, and view the port in the Connection Address column.
• -d indicates the name of the database to be connected. (The default database name is postgres.)
• -W indicates the password for the connection must be input. After running the command, input the password as prompted.
Example:
Run the following command as user root to connect to a postgres DB instance:
psql --no-readline -U root -h 192.168.0.44 -p 8635 -d postgres -W
----End
. SSL Connection
1. On the Instance Mgmt page, click here to go to the Developer Tool Center page and download the root certificate and certificate bundle.
1. Downloading the root certificate
[pic]
1. Upload the root certificate to the ECS to be connecting to the PostgreSQL DB instance.
2. Connect to the DB instance. In Linux, for example, run the following command:
psql --no-readline -h -p "dbname= user= password= sslmode=verify-ca sslrootcert="
[pic]
• -h indicates the IP address of the primary DB instance. To obtain the IP address, go to the Instance Mgmt page, locate the target primary DB instance in the DB instance list area, and view the IP address in the Connection Address column.
• -p indicates the database port in use. The default value is 8635. To obtain the database port, go to the Instance Mgmt page, locate the target primary DB instance in the DB instance list area, and view the port in the Connection Address column.
• dbname indicates the name of the database to be connected. (The default database name is postgres.)
• user indicates the user name, that is, the RDS database account. (The default administrator account is root.)
• password indicates the login password of the user.
• sslmod indicates an SSL connection mode. Set it to verify-ca to use the CA to check whether the service is trusted.
• sslrootcert indicates the directory of the SSL connection CA certificate. The certificate should be stored in the directory where the command executes.
For example, run the following command as user root to connect to a postgres DB instance through SSL:
psql --no-readline -h 192.168.0.44 -p 8635 "dbname=postgres user=root sslmode=verify-ca sslrootcert=/root/ca.pem"
3. The SSL connection is established if information similar to the following is displayed after you log in to the database:
SSL connection (protocol: TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384, bits: 256, compression: off)
----End
3 Connecting to an RDS Microsoft SQL Server DB Instance
You can use a Microsoft SQL Server client to connect to a DB instance through a common or an SSL connection. The SSL connection is encrypted and more secure.
. Preparations
1. Prepare an ECS.
To connect to a DB instance through an ECS, create an ECS first.
For details on how to create and connect to an ECS, see How Can I Create and Connect to an ECS?
2. Install the Microsoft SQL Server client on the ECS prepared in 1.
For details, see How Can I Install SQL Server Management Studio?
. Common Connection
1. Log in to the ECS.
1. Use SQL Server Management Studio to connect to a Microsoft SQL Server DB instance.
1. Connecting to a Microsoft SQL Server DB instance
[pic]
[pic]
• Server name indicates the IP address and port of the primary DB instance. To obtain the server name, go to the Instance Mgmt page, locate the target primary DB instance in the DB instance list area, and view the IP address and port in the Connection Address column.
• Authentication indicates the authentication mode. Select SQL Server Authentication for it.
• Login indicates the user name, that is, the RDS database account. (The default administrator account is rdsuser.)
• Password indicates the password of the database account.
For example, connect to a DB instance as user rdsuser.
2. Connecting to a DB instance
[pic]
----End
. SSL Connection
1. On the Instance Mgmt page, click here to go to the Developer Tool Center page and download the root certificate and certificate bundle.
1. Downloading the root certificate
[pic]
1. Upload the root certificate to the ECS to be connecting to the Microsoft SQL Server DB instance.
2. Import the root certificate to the ECS Windows OS by referring to How Can I Import the Root Certificate to the Windows OS?
3. Use SQL Server Management Studio to connect to the DB instance as user rdsuser through SSL.
1. Input the login username and password in the Login and Password text boxes, respectively, and click Options.
1. Login
[pic]
[pic]
• Server name indicates the IP address and port of the primary DB instance. To obtain the server name, go to the Instance Mgmt page, locate the target primary DB instance in the DB instance list area, and view the IP address and port in the Connection Address column.
• Authentication indicates the authentication mode. Select SQL Server Authentication for it.
• Login indicates the user name, that is, the RDS database account. (The default administrator account is rdsuser.)
• Password indicates the password of the database account.
2. On the Connection Properties page, specify parameters and click Encrypt connection.
2. Connection Properties
[pic]
[pic]
Selecting Encrypt connection indicates that using SSL to encrypt connections to a DB instance. (Encrypt connection is unselected by default.)
----End
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related searches
- in this instance another phrase
- in this instance synonym
- in this instance meaning
- in another instance synonym
- instance definition
- for instance synonym
- azure sql managed instance hyperscale
- sql managed instance hyperscale
- azure sql managed instance vs sql db
- managed instance vs sql db
- sql managed instance limitations
- sql managed instance authentication