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

RDS for MySQL DB Instance Inaccessible

Updated on 2024-10-24 GMT+08:00

Scenario

When the MySQL client attempted to connect to a database, the following error information is displayed:

  • Fault 1
    ERROR 1045 (28000): Access denied for user 'root'@'192.168.0.30' (using password:YES)
  • Fault 2
    ERROR 1226 (42000): User 'test' has exceeded the 'max_user_connections' resource (current value:10)
  • Fault 3
    ERROR 1129 (HY000): Host '192.168.0.111' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'

Fault 1

  1. Check whether the password of user root is correct.

    ERROR 1045 (28000) is usually caused by an incorrect password so you need to check the password first.

    select password('Test1i@123');
    select host,user,Password from mysql.user where user='test1';

    An incorrect password will cause a login failure as shown in the following figure.

  2. Check whether the ECS or device has the permission to connect to the DB instance.

    select user,host from mysql.user where user='username';

    If you want to log in to the database from another ECS or device, log in to the database as user root and grant the permission to the user.

    For example, if the IP address of the ECS or device is 192.168.0.76, run the following command:

    GRANT all privileges ON test.* TO 'test1'@'192.168.0.76' identified by 'Test1i@123';

    flush privileges;

  3. Check whether the RDS for MySQL client can ping the virtual IP address of the DB instance and use telnet to check the connection to the port.

    If the ping and telnet operations are successful, ERROR 1045 (28000) is not caused by the virtual IP address or port of the DB instance.

  4. Check the security group and rules of the DB instance.
  5. Query the user table and check user information.

    The command output indicates that there are two root users.

    When the client is in the network segment 192.168.***.***, RDS for MySQL authenticates the user root@'192.168.%'. However, if the password is root@'%', there will be a login failure. ERROR 1045 (28000) is caused by an invalid password.

    NOTE:

    User root@'%' is used for setting a password when you create a DB instance on the RDS console.

Fault 2

  1. Check whether the max_user_connections option is set when you create an RDS for MySQL user, which limits the number of connections.

    select user,host ,max_user_connections from mysql.user where user='test';

    The command output indicates that the connection failed because the max_user_connections option was used.

  2. Increase the maximum number of connections for the user.

    alter user test@'192.168.0.100' with max_user_connections 15

  3. Query the modification result and check whether the database can be connected to.

Fault 3

  1. 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.
  2. Log in to the MySQL database as user root and run flush hosts.

    Alternatively, run the following command:

    mysqladmin flush-hosts –u<user> –p<password> -h<ip> -P<port >

  3. Use the MySQL client to connect to the database again.

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