Mysqli_real_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES)

Keywords: WordPress Multisite - Google Cloud Platform - Technical issue - Credentials
Description:
Got this error while trying to login phpMyAdmin, checked a lot of guides…

  1. https://docs.bitnami.com/general/faq/get-started/access-phpmyadmin/ Got the bitnami-base-password, but same error.
  2. https://docs.bitnami.com/google/faq/get-started/find-credentials/ Got the same pw as bitnami-base-password, of course same error.
  3. What is the default phpMyAdmin password? Used the suggested username and pw…root / bitnami, but same error.

Tried both 80 & 443 in PuTTY SSH Tunnels Destination port, both got me to the phpMyAdmin login page successfully, but same error.

Any suggestion where should I look into…
Thanks

Hi @samuel1,

Could you try this guide:

https://docs.bitnami.com/general/apps/wordpress-multisite/get-started/access-phpmyadmin/

Please let me know if you find any issues.


Please, click on :heart: if you think my answer was helpful

Hi @michiel

I did already, as I mentioned the first guide…access-phpmyadmin Got the bitnami-base-password, but same error.

Thanks

Hello @samuel1,

First, let’s check if MySQL is running. For that, access your instance via SSH and execute:

sudo /opt/bitnami/ctlscript.sh status mysql

If it is stopped, start it:

sudo /opt/bitnami/ctlscript.sh start mysql

Then, we should check if you are able to access mysql via command line. For that, execute this command:

sudo /opt/bitnami/mysql/bin/mysql -uroot -pPASSWORD

where PASSWORD needs to be changed with your MySQL root password.

Please confirm if the steps below worked properly for you.

Hi David,

It returned the same ERROR 1045 (28000): Access denied for user
‘root’@‘localhost’
(using password: YES) after executing the command.

Does that means the pw I copied from bitnami-base-password under VM
instance details is wrong? where can I find the correct pw or change one?

Thanks,
Sam

Hello @samuel1,

This guide explains how to reset your MySQL root password:
https://docs.bitnami.com/general/apps/wordpress/administration/change-reset-password/

I hope it helps

Hi @davidg

According to the guide, I should Create a file in /home/bitnami/mysql-init
to reset the password, but there is no such a folder “mysql-init”, only a
file “bitnami_credentials” with the same password as bitnami-base-password.

Should I create the folder “mysql-init” or it might be something suspicious?

Thanks,

Hi @samuel1,

That sentence is a bit confusing. It means to create a file called mysql-init in /home/bitnami. Also, this approach does not work with MySQL 8 (we will update our documentation). In this case, you should use the following commands:

   echo "ALTER USER 'root'@'localhost' IDENTIFIED BY 'NEW_PASSWORD';" > /home/bitnami/mysql-init
   sudo /opt/bitnami/ctlscript.sh stop mysql
   sudo /opt/bitnami/mysql/bin/mysqld_safe --pid-file=/opt/bitnami/mysql/data/mysqld.pid --datadir=/opt/bitnami/mysql/data --init-file=/home/bitnami/mysql-init --lower_case_table_names=1 2> /dev/null &
   sudo /opt/bitnami/ctlscript.sh restart mysql
   rm /home/bitnami/mysql-init

Regards

Hi @davidg
Got it working
Thanks very much

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.