Bobcares Logo
Search Call 1-800-383-5193 Emergency Contact
Bobcares Logo
Search Call 1-800-383-5193 Emergency Contact
Emergency Contact

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

  • A 15-Minute Self-Hosted RAG Stack Tutorial: From Zero to Production
  • Designing Data Pipelines That Prevent Outages Across Global Systems
  • Deployment Automation: Deploy With Efficiency and Consistency
  • What Is Proactive Monitoring? A Complete Guide
  • AI Use Cases: How Artificial Intelligence Is Used Across Industries

Categories

  • Advanced Vulnerability
  • AI Services
  • AI Support
  • AIOps
  • Amazon Web Services (AWS)
  • Apache
  • API Integration
  • Application Development
  • Azure
  • 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
  • Filezilla
  • FTP
  • Google cloud platform
  • HAProxy
  • Headless CMS Integration
  • Hosting Support
  • IIS
  • Infrastructure Management & Optimization
  • Kubernetes
  • KVM
  • Laravel
  • Latest
  • Linode
  • Litespeed
  • LXC/LXD
  • Magento
  • Mobile App Development
  • MongoDB
  • Moodle
  • MySQL
  • NFS
  • Nginx
  • OnApp
  • Outsourced Support
  • OVH
  • ovirt
  • pfsense
  • Plesk
  • PostgreSQL
  • PowerDNS
  • Product Engineering
  • Proxmox
  • RedHat
  • Redis
  • Sendmail
  • Server Administration
  • Server Management
  • Software Development
  • 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 sales@bobcares.com | Phone 1-800-383-5193

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 & Delivery Enablement

AI Services

  • AI Readiness & Use-Case Discovery
  • AI Integration & Application Enablement
  • Intelligent Automation & AI Workflows

Infrastructure Management

  • 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
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.

  • Careers
  • |
  • Cookie Policy
  • |
  • GDPR
  • |
  • Privacy Policy
  • |
  • Terms and 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