El contenido no se encuentra disponible en el idioma seleccionado. Estamos trabajando continuamente para agregar más idiomas. Gracias por su apoyo.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Connecting to a DB Instance Through a Private Network

Updated on 2024-04-11 GMT+08:00

You can connect to a DB instance through a non-SSL connection or an SSL connection. The SSL connection encrypts data and is more secure.

Prerequisites

  1. You have logged in to an ECS.
    • To connect to a DB instance through an ECS, you must ensure that:
      • The ECS and DB instance must be in the same VPC.
      • The ECS must be allowed by the security group to access the DB instance.
        • If the security group with which the target DB instance is associated is the default security group, you do not need to configure security group rules.
        • If the security group with which the target DB instance is associated is not the default security group, check whether the security group rules allow the ECS to connect to the DB instance. For details, see section Configuring Security Group Rules.

          If the security group rules allow the access from the ECS, the ECS can connect to the DB instance.

          If the security group rules do not allow the access from the ECS, you need to add a security group rule. The ECS must be allowed by the security group to access the DB instance.

  2. You have installed a database client to connect to DB instances.

    You can use a database client to connect to the target DB instance in the Linux or Windows OS.

    • In the Linux OS, install the MySQL client on the device that can access RDS. It is recommended that you download a MySQL client running a version later than that of the DB instance.

      For details about how to obtain and install the MySQL client, see section How Can I Install the MySQL Client?

Using MySQL-Front to Connect to a DB Instance

  1. Start MySQL-Front.
  2. In the displayed dialog box, click New.

    Figure 1 Connection management

  3. Enter the information of the DB instance to be connected and click Ok, as shown in Figure 2.

    Figure 2 Adding an account
    Table 1 Parameter description

    Parameter

    Description

    Name

    Name of the database connection task. If you do not set this parameter, it will be the same as the Host value by default.

    Host

    Floating IP address of the DB instance to be connected. To view the floating IP address and port of the DB instance, perform the following steps:
    1. Log in to the RDS console.
    2. Select the region in which the DB instance is located.
    3. Click the target DB instance to enter the Basic Information page.
    4. In the Connection Information area, view the floating IP address and database port.

    Port

    Database port of the DB instance.

    User

    Name of the user who will access the DB instance. The default user is root.

    Password

    Password of the RDS database account.

  4. 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 is successfully connected.

    Figure 3 Opening a session

SSL Connection

  1. Log in to the management console.
  2. Click in the upper left corner and select a region and a project.
  3. Click Service List. Under Database, click Relational Database Service. The RDS console is displayed.
  4. On the Instance Management page, click the instance name to go to the Basic Information page.
  5. In the DB Information area, check whether SSL is enabled.

    • If yes, go to 6.
    • If no, click . In the displayed dialog box, click Yes. Then go to 6.

  6. Click next to SSL to download the root certificate or certificate bundle.
  7. Import the root certificate to the Windows or Linux OS on the ECS. For details, see How Can I Import the Root Certificate to a Windows or Linux OS?

    NOTE:
    • Since April 2017, RDS has offered a new root certificate that has a 20-year validation period. The new certificate takes effect after DB instances are rebooted. Replace the old certificate before it expires to improve system security.

      For details, see section How Can I Identify the Validity Period of an SSL Root Certificate?

    • You can also download the certificate bundle, which contains both the new certificate provided since April 2017 and the old certificate.

  8. Connect to the RDS DB instance. The Linux OS is used as an example.

    • Method 1

      mysql -h <host> -P <port> -u <userName> -p --ssl-ca=<caName>

    • Method 2

      mysql -h <host> -P <port> -u <userName> -p --ssl-capath=<caPath>

    Table 2 Parameter description

    Parameter

    Description

    <host>

    Floating IP address. To obtain this parameter, go to the Basic Information page of the DB instance and view the floating IP address in the Connection Information area.

    <port>

    Database port. By default, the value is 3306. To obtain this parameter, go to the Basic Information page of the DB instance and view the database port in the Connection Information area.

    <userName>

    Username of the RDS database account. The default administrator is root.

    <caName>

    Name of the CA certificate. The certificate should be stored in the directory where the command is executed.

    <caPath>

    Path of the CA certificate.

    For example, to connect to a DB instance through an SSL connection as user root, run the following command:

    mysql -h 172.16.0.31 -P 3306 -u root -p --ssl-ca=ca.pem

    Enter the password of the database account if the following information is displayed:

    Enter password:

Utilizamos cookies para mejorar nuestro sitio y tu experiencia. Al continuar navegando en nuestro sitio, tú aceptas nuestra política de cookies. Descubre más

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback