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
On this page

Show all

Help Center/ Data Admin Service/ FAQs/ Managing connections/ What Should I Do If I Can't Connect to My ECS (MySQL) Instance?

What Should I Do If I Can't Connect to My ECS (MySQL) Instance?

Updated on 2023-12-07 GMT+08:00
  1. Error message: Access denied for user 'user_name'@'100.xxx.xx.xx' (using password: YES)
    1. Error cause: The username or password of the self-built database on the ECS is incorrect.

      Solution: Check whether the username and password are correct. If the username and password are correct, log in to the database using a client or the CLI tool and run select * from mysql.user where user = 'user_name' to view the account. Make sure that the DAS CIDR block is within the CIDR block of the user. user_name @ % and user_name @100.% are two different users whose passwords and permissions are independent. Enter the password of user user_name @100.%.

    2. Error cause: The IP address of the DAS server is not in the whitelist of the login user.

      Solution: Log in to the database using the client or CLI tool, and create a user account that can be used to access the database through DAS.

      create user 'user_name'@'100.%' identified by 'password';
      grant all privileges on *.* to 'user_name'@'100.%';
      NOTE:
      • Ensure that the IP address of the DAS server is in a CIDR block starting with 100. Add the IP address to the whitelist of the login user.
      • Grant permissions to user user_name@100.% based on service requirements.
    3. Error cause: The SSL function is not enabled on the server.

      Solution: Run the following statement to check whether the user is an SSL user. If yes, enable SSL on the RDS instance details page. The user is an SSL user if the ssl_type field has a value.

      select user, host, ssl_type from mysql.user where user = 'user_name';
  2. Error message: Host 'xxx.xxx.xx.xx' is not allowed to connect to this MySQL server

    Error cause: The database username you entered does not support remote login. For example, if you enter username root, but only username root@localhost is configured in the mysql.user table, the specified user can only log in locally.

    Solution: Use a client or CLI tool to log in to the self-built database and create a user account that supports remote login.
    create user 'user_name'@'100.%' identified by 'password'; 
    grant all privileges on *.* to 'user_name'@'100.%';
    NOTE:
    • Ensure that the IP address of the DAS server is in a CIDR block starting with 100. Add the IP address to the whitelist of the login user.
    • Grant permissions to user user_name@100.% based on service requirements.
  3. Error message: Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
    1. Error cause: The security group rules do not allow inbound traffic on the port.

      Solution: Modify the security group rules by referring to How Do I View and Modify ECS Security Group Rules?

    2. Error cause: The firewall policy does not allow inbound traffic on the port.

      Solution: Modify the firewall policy by referring to How Do I View and Modify Firewall Rules?

    3. Error cause: The remote login times out because the DNS resolution takes a long period of time.

      Solution: Rectify the fault by performing the following operations:

      1. Search for the configuration file of the self-built database in directory /etc/my.cn, enter the following content in [mysqld], save the change and exit.
        skip-name-resolve
        NOTE:

        The default location of the configuration file is /etc/my.cnf. If you store the file in the specified path, modify the directory accordingly.

      2. Run systemctl restart mysqld to restart the database and log in again.
  4. Error message: Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server

    Error cause: The network between the DAS server and the target instance is disconnected.

    Solution: Check whether the firewall of the instance is correctly configured and whether the required port is enabled. If the firewall is abnormal or the port is not enabled, rectify the fault and try again. If the fault persists, Submit a work ticket to contact customer service.

  5. Error message: Instance connect timeout, please login again.

    Error cause: The connection to the DAS server timed out.

    Solution: Rectify the fault by performing the following operations:
    1. Log in to a remote ECS and run the iptables -S | grep input command to view firewall configurations of the instance. If the self-built database port is not included in the firewall whitelist, add an iptables rule or run the systemctl stop iptables command to disable the firewall to allow traffic through this port, and try again.
    2. Log in to the ECS again and run the ps -ef | grep mysql command to check whether the database process is running. If processes mysqld_safe and mysqld are both running, the database process is normal. If the process is not running, run systemctl start mysqld to restart the database and try again.
    3. If the fault persists, submit a work ticket to contact customer serviceContact technical support.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback