Access Denied for user 'root'@'localhost' phpMyAdmin

Websolutionstuff | Jul-28-2023 | Categories : Other

phpMyAdmin is a popular web-based tool used to manage MySQL databases. As a powerful and convenient tool, it allows users to perform various database tasks with ease. However, encountering the "Access Denied" error for the user 'root'@'localhost' can be frustrating for developers and administrators.

In this article, we'll explore the possible causes of this error and provide practical solutions to resolve it.

So, let's see access denied for user 'root'@'localhost' phpMyAdmin ubuntu, access denied for user 'root'@'localhost' phpMyAdmin XAMPP, phpMyAdmin access denied for user 'root'@'localhost'.

When you try to log in with the root user you can not enter phpMyAdmin as root in (MySQL 5.7.26 ubuntu 18, ubuntu 20, ubuntu 22). The error is.

Mysqli_real_connect(): Access denied for user ‘root’@‘localhost’


This issue arises from the fact that the Plugin for the root user is auth_socket.

To see this status enter MySQL by

sudo mysql -u root -p

After that, run the following command.

mysql>  SELECT User, Host, plugin FROM mysql.user;

You will see:


To fix this issue use this command:

mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'YOUR_ROOT_PASSWORD';

Note: YOUR_ROOT_PASSWORD’ which must be your root password.

The status must be finally the same as:


And again try to log in phpMyAdmin via the root user and your password.


You might also like:

Recommended Post
Featured Post
How To Create Web Notifications In Laravel 9 Using Pusher
How To Create Web Notification...

In this article, we will see how to create web notifications in laravel 9 using pusher. Here, we will learn how to...

Read More


How To Get Current Route In React JS
How To Get Current Route In Re...

As a web developer working with React JS, I've experienced the sheer power and efficiency of this JavaScript library...

Read More


How To Remove Specific Item From Array In Javascript
How To Remove Specific Item Fr...

In this article, we will see how to remove a specific item from an array in javascript. We will use the indexOf() m...

Read More


Laravel 8 Class NumberFormatter Not Found
Laravel 8 Class NumberFormatte...

In this example we will see example of laravel 8 class numberformatter not found. For numberformatter we need PHP 5...

Read More