Software⏱️ 2 min read📅 2026-05-31

How to Fix: Access Denied for User 'root'@'localhost' (using password: YES) - No Privileges?

MySQL Workbench issue with root user privileges.

Quick Answer: Check the MySQL server configuration and ensure that the localhost host has the correct privileges. You can try setting the default privilege level for the localhost host to 'GRANT ALL PRIVILEGES'.

To resolve the 'Access Denied for User 'root'@''(using password: YES) - No Privileges?' error, you must grant your MySQL user root privileges.

💡 Why You Are Getting This Error

  • [Cause]

🔧 Proven Troubleshooting Steps

Method 1: Granting Root Privileges

  1. Step 1: Use the MySQL command line tool or MySQL Workbench to execute the following query: GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost'

Method 2: Updating Privileges Manually

  1. Step 1: Open the MySQL command line tool and execute the following query: SHOW GRANT PRIVILEGES FOR 'root'@'localhost';
  2. Step 2: Update the privileges by executing the following query: ALTER USER 'root'@'localhost'
  3. Step 3: Grant all privileges using the following query: GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost'

✨ Wrapping Up

After granting the root privileges, restart your MySQL server or reload the privilege tables using FLUSH PRIVILEGES. You should now be able to access your database without any 'Access Denied' errors.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions