Bobcares Logo
Search Phone User Profile Emergency Contact
Bobcares Logo
Search Phone User Profile Emergency Contact
Emergency Contact Client Portal
SOLUTIONS
Product Engineering
MVP Build
MVP to Scale
Product Maintenance
Digital Transformation
Process Digitization & Automation
Systems Integration & Workflow Orchestration
Data Enablement & Decision Support
Application & Platform Modernization
Transformation Execution
AI Services
AI Readiness & Use-Case Discovery
AI Integration & Application Enablement
Intelligent Automation & AI Workflows
Infrastructure Management & Optimization
Always-On Infrastructure Management
Proactive Monitoring & Incident Prevention
Cloud Cost Control & Optimization (FinOps)
Outsourced IT & End-User Support
Managed Infrastructure Execution Support
DevOps & Automation Services
CI/CD & Release Automation
Infrastructure as Code & Platform Standardization
Reliability Engineering & Observability
DevSecOps Enablement
Cybersecurity
Security Assessment & Risk Posture
Threat Monitoring & Incident Response
Infrastructure & Cloud Security Hardening
Vulnerability Assessment & Penetration Testing (VAPT)
Backup, Disaster Recovery & BCP

MySQL Error mysqli_real_connect HY000 3118: Root Account Locked

by Anusree V Anand | Nov 3, 2025 | Latest, MySQL | 0 comments

Resolve MySQL access denied for user root localhost account is locked quickly. Our MySQL Support team is ready to assist you.  

MySQL Error mysqli_real_connect HY000 3118: Root Account Locked

If you see “access denied for user ‘root’@’localhost’. Account is locked”, MySQL has locked your root account. This lock blocks your applications or scripts from connecting to the database. Usually, multiple failed login attempts or strict security settings trigger the issue. Understanding the cause and applying the right steps to fix it helps you save time, prevent downtime, and keep your database running smoothly.

An Overview:
    1. What Causes the System to Lock the Root Account
    2. How to Identify the Issue
    3. How to Fix the Locked Root Account
    4. Preventing Root Account Lockouts

MySQL Error mysqli_real_connect HY000 3118: Root Account Locked

What Causes the System to Lock the Root Account

Before troubleshooting, note that the root account may become locked due to several reasons:

  • Too many failed login attempts: Repeated unsuccessful logins trigger automatic account locks.
  • Administrative action: An administrator may intentionally lock the account for maintenance or security.
  • Expired or incorrect password: Using the wrong password multiple times can lock the account.
  • Security plugins or server settings: Some configurations enforce locks after unusual activity, and in rare cases you may need to review running sessions using processlist MySQL to ensure no automated script is repeatedly attempting access.

Subscribe to our newsletter for the latest updates, news, and features.

How to Identify the Issue

Check the account status directly in MySQL to confirm it is locked:

SELECT user, host, account_locked FROM mysql.user WHERE user = 'root';

In that case, if the account_locked column shows Y, the account is locked and needs to be unlocked.

Having trouble connecting to MySQL?

Chat animation


How to Fix the Locked Root Account

Unlocking the Account
  1. Open your terminal or command prompt.
  2. Log in to MySQL:
mysql -u root -p
  1. Unlock the account:
ALTER USER 'root'@'localhost' ACCOUNT UNLOCK;
  1. Reload privileges to apply changes:
FLUSH PRIVILEGES;

After this, try connecting with your application.

Preventing Root Account Lockouts

To reduce the chances of this error:

  • Use a strong and memorable root password.
  • Limit root access for applications and create dedicated users with appropriate privileges.
  • Monitor login attempts and review MySQL logs for unusual activity.
  • Ensure scripts and applications use correct credentials consistently especially if you often need to access WAMP MySQL from the Command line for local development.

[Need assistance with a different issue? Our team is available 24/7.]

Conclusion

The access denied for user root localhost account is locked error blocks MySQL access. Unlocking the account or resetting the root password restores connectivity and ensures your database runs smooth

Related posts:

    1. Incompatible with sql_modeonly_full_group_by
    2. Scale WordPress Sites with MySQL Replicas and HyperDB: How to?
    3. MySQL flush privileges Ansible | All About
    4. MySQL auto increment skipping numbers | Causes & Fixes

Submit a Comment Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • How to Achieve ISO Compliance in Cloud Hosting
  • Managed IT Services Cost and Pricing Guide for 2026
  • AWS CloudWatch: Monitoring, Alerts, and Best Practices
  • How to Reduce Cloud Bills: 11 Practical Ways
  • Hybrid Cloud Management: Best Practices and Tools

Categories

  • Advanced Vulnerability
  • AI Automation
  • AI Services
  • AI Support
  • AIOps
  • Amazon Web Services (AWS)
  • Apache
  • API Integration
  • Application Development
  • Azure
  • Business Process Management
  • Business Process Reengineering
  • Cloud Cost Optimization
  • Cloud Management
  • Cloud-Native Application
  • Cloudflare
  • cPanel
  • cPanel migration
  • Cyberpanel
  • DDoS
  • Development Service
  • DevOps
  • DevOps Consulting
  • DevSecOps
  • Digital Transformation
  • DigitalOcean
  • DirectAdmin
  • Docker
  • Drupal
  • Ecommerce
  • Feedback Management Systems
  • Filezilla
  • FTP
  • Full-Stack Product Development
  • Google cloud platform
  • HAProxy
  • Headless CMS Integration
  • Hosting Support
  • Hybrid Cloud Management
  • IIS
  • Infrastructure Management & Optimization
  • Kubernetes
  • KVM
  • Laravel
  • Latest
  • Legacy Application Modernization
  • Linode
  • Litespeed
  • LXC/LXD
  • Magento
  • Managed cloud services
  • Managed IT Services
  • Microservices Architecture
  • Mobile App Development
  • MongoDB
  • Moodle
  • MySQL
  • NFS
  • Nginx
  • OnApp
  • Outsourced Support
  • OVH
  • ovirt
  • Performance Optimization & Monitoring
  • pfsense
  • Plesk
  • PostgreSQL
  • PowerDNS
  • Product Engineering
  • Proxmox
  • RedHat
  • Redis
  • SaaS Development
  • Sendmail
  • Server Administration
  • Server Management
  • Software Development
  • Software Testing
  • SQLServer
  • Technical Support
  • UI/UX
  • Virtualizor
  • VMware
  • VPN
  • Vulnerability Scanning
  • Vultr
  • Web Development
  • Windows
  • WordPress
  • WordPress Hosting
  • WordPressHA

Subscribe to our newsletter

Footer newsletter

Email inquiry@bobcares.com | Phone 1-800-383-5193

Solutions

  • Product Engineering
  • Digital Transformation
  • AI Services
  • Infrastructure Management & Optimization
  • DevOps & Automation Services
  • Cybersecurity

Services

  • Managed IT Services
  • Cloud Modernization Services
  • Custom Software Development Services
  • DevOps services
  • Business Process Management Services

Insights

  • Case Studies
  • Blog

Company

  • About Us
  • Our Partners
  • Careers
  • CSR
Product Engineering +
Web Development MVP to Scale Builds Microservices Architecture Agile & Dev Team Augmentation Mobile Apps Ecommerce UI/UX Design QA & Test Automation
Digital Transformation +
Legacy Modernization Workflow Automation Data-Driven Dashboards CRM / ERP Integration Business Process Re-engineering
AI Services +
AI & Machine Learning AIOps Intelligent Automation Business Intelligence & Analytics AI Installation & Compute
Infrastructure Management +
Cloud Setup Cloud Migration Managed Cloud Services Server & Hosting Cost Optimization Performance Optimization Outsourced Support
DevOps & Automation Services +
CI/CD Setup Kubernetes & Docker Infrastructure as Code Cloud-Native Migration DevSecOps
Cybersecurity & Compliance Services +
Security Hardening VAPT Incident Response Backup & DR

© 2026 Bobcares. All Rights Reserved.

  • Cookie Policy
  • |
  • GDPR
  • |
  • Privacy Policy
  • |
  • Terms of Service
  • LinkedIn
  • YouTube
  • Instagram
  • Facebook

Preview of the new Bobcares experience
NEW UPDATE
See What’s New
at Bobcares

Discover a faster, clearer view of our services and expertise.


Explore the New Experience
Arrow Right