Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

tani's avatar
Level 1

How to reset root password when denied access to user in ubuntu ec2 instance

Hello, I have installed phpmyadmin on ubuntu ec2 instance. Phpmyadmin page is showing up in front page, but I am receiving error denying access to the root user. I had already set up password for the root during installation, but when I try to login using mysql -u root -p then I am getting error access denied for user 'root@localhost' (using password: YES). How can I setup root password so that I can login into phpmyadmin?

0 likes
4 replies
tani's avatar
Level 1

Thanks, but I am doing in ubuntu. I have installed phpmyadmin, and set up root password during the installation of phpmyadmin package. But now when I try to login it is denying me the access. I don't know how to do it in ubuntu.

MichalOravec's avatar

Propably in ubuntu will be same, just find path to config.inc.php. And follow same advice from that link.

tani's avatar
Level 1

Okay, I have checked the file and it is already written $cfg [‘Servers’] [$i] [‘auth_type’] = ‘cookie’; in “config.inc.php” file. I don't know now what to do.

Please or to participate in this conversation.