ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

Keywords: MySQL - AWS - How to - Application configuration

Description:
Hi, I am trying to log in to PHPMyAdmin with the root user, but I am getting this error -->ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: NO) <— my root user haven’t password so the command mysql -u root should let log me in with root user but against this I am getting error. The question is what is the way to log in into mysql with root user.

Hi @luka.sheylashvili,

To log in PhpMyAdmin you need to create an SSH tunnel. Did you follow the steps from this guide?

https://docs.bitnami.com/aws/faq/get-started/access-phpmyadmin/

Regards,
Michiel

Hello sir,

Yes everything is fine I am able to log in with db user which is controlling WordPress database, but I need to create new database for another application, there I need root user privileges to create new database and user. That’s why I need to log in with root user. Also I enable AllowNoPassword from false to true.

Please give me some advice :pray:.

Thanks and kind regards

Hi @luka.sheylashvili,

The guide explains how to log in with the root user. Could you use 127.0.0.1:80 instead of localhost:80 in the Putty configuration?

Regards,
Michiel

Hello @michiel

I write this configuration in putty but error is still the same mysqli::real_connect():(HY000/1045):Access denied for user ‘root’@‘localhost’ (using password: NO)

Hi @luka.sheylashvili.

Can you try logging in to MySQL directly?

First login to the console:

https://docs.bitnami.com/installer/how-to/understand-bnconsole/

And then execute this command:

mysql -u root -p

Then enter your password.

Regards,
Michiel

Thanks @michiel

I already make this command, but how I see it’s same error as previous on the PhpMyadmin.

I need to find out what is this error actually mean.

Thanks Regards.

Hi @luka.sheylashvili,

It means the password is incorrect. The following guide shows how you can reset your password:

https://docs.bitnami.com/aws/apps/wordpress/administration/change-reset-password/#reset-the-mysql-root-password

Regards,
Michiel

Hello @michiel,

I checked it Into config file where username was root and password was ’ ’ (empty space).
I think my root user haven’t password.

Thanks and kind regards

Hi @luka.sheylashvili,

Could you reset the password and check if that solves the issue?

Regards,
Michiel

Hi @michiel,

Our stack is using only mysql
I cannot see MariaDb

Thanks, Regards

Hi @luka.sheylashvili,

The process is the same you only need to replace mariadb with mysql in the paths and in the non mysql commands:

 sudo /opt/bitnami/ctlscript.sh stop mysql

 sudo /opt/bitnami/mysql/bin/mysqld_safe --defaults-file=/opt/bitnami/mysql/my.cnf --init-file=/tmp/mysql-init 2> /dev/null &

sudo /opt/bitnami/ctlscript.sh restart mysql

Regards,
Michiel

Hello @michiel,

I found root password at pwd bitnami.
I saw the root hasn’t password at configuration file but that was wrong. Now I am able to login woth root.

Thanks and kind regards

1 Like