Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

the error messages

I am doing an online course from coursera where they tolm me to install phpmyadmin.

NOW I am a total beginner in this thing so I am not able to do much research upon that and now somehow, after I installed MySQL and phpmyadmin, in the localhost, I am getting some errors, is that common? Because the other participants in the course are not getting them. If that's fatal or will limit some of my obvious abilities, please tell me how to cure it.

BTW If you didn't noticed the errors are:

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

and

Connection for controluser as defined in your configuration failed.

Some more details:

  1. PHP version is 7.4
  2. Operating System is Ubuntu 20.04
like image 813
Agent Pluton Avatar asked Aug 29 '20 16:08

Agent Pluton


People also ask

Why does PhpMyAdmin say error?

You may receive an error message stating that phpMyAdmin needs a PHP version within a specific range. This might happen if you're running an outdated version of PHP, or a new update is not compatible with your version of MAMP. In this case, you”ll need to change the PHP version of your MAMP application.

What are some common errors with mysqli_real_connect?

BTW If you didn't noticed the errors are: mysqli_real_connect (): (HY000/1045): Access denied for user 'phpmyadmin'@'localhost' (using password: YES) Connection for controluser as defined in your configuration failed.

What does mysqli_real_connect (hy000/1045) mean?

Show activity on this post. mysqli_real_connect (): (HY000/1045): Access denied for user 'phpmyadmin'@'localhost' (using password: YES) The connection to the controluser as defined in your configuration has failed.. Show activity on this post.

Which is can’t log into phpMyAdmin?

Then user has to face the problem, Which is Can’t log into phpMyAdmin: mysqli_real_connect (): (HY000/1698): Access denied for user ‘root’@’localhost’. This error message usually appears for new installations of MySQL when you try to login in PHPmyadmin with the root user. But in this tutorial, you have been given a very easy solution.

How to fix MySQL_Connect Access Denied for user ‘root’@’localhost?

Solve mysql_connect access denied for user ‘root’@’localhost’ (using password: yes/no) 1 Step 1 – Login as Root user MySQL. Installed MySQL and try to access phpmyadmin on the local/server machine with the root user, the command you use ... 2 Step 2 – Restart Apache Server. 3 Step 3 – Test Root MySQL User For Access PHPMyadmin.


Video Answer


2 Answers

I've just installed LAMP on a new PC, and got the same problem.
Linux Mint 20 + MariaDB.
Password for root and phpmyadmin was already ok, but the error was still there.

Finally I discovered another configuration file, that sets the phpmyadmin password; you have to edit it:

$ sudo nano /etc/dbconfig-common/phpmyadmin.conf

set the correct password (= dbc_dbpass) for user dbc_dbuser='phpmyadmin'
Use ctrl-O to save, then ctrl-X to exit. Then launch the command:

$ sudo dpkg-reconfigure phpmyadmin

(Do NOT reinstall the DB).
In my PC il works!

like image 99
Filippo de Grenet Avatar answered Oct 14 '22 00:10

Filippo de Grenet


I was using MaridDb solved this issue with the following:

sudo systemctl stop mariadb
sudo mysqld_safe --skip-grant-tables --skip-networking &
mysql -u root

You will see a prompt like below:

Type help; or \h for help. Type \c to clear the current input statement.

MariaDB [(none)]> FLUSH PRIVILEGES;

For MySQL 5.7.6 and newer as well as MariaDB 10.1.20 and newer

ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';

OR:

For MySQL 5.7.5 and older as well as MariaDB 10.1.20

SET PASSWORD FOR 'root'@'localhost' = PASSWORD('new_password');
like image 4
Amandeep Singh Avatar answered Oct 14 '22 02:10

Amandeep Singh