6

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
halfer
  • 19,824
  • 17
  • 99
  • 186
Agent Pluton
  • 113
  • 1
  • 2
  • 9
  • Try logging on a `root` without a password!! Or if your tutorial made you set a password for `root` then us that password – RiggsFolly Aug 29 '20 at 16:33
  • If you are a complete beginner, I would suggest you stick to a PHP7.4 as 7.5 is not actually relaeased yet and you may get odd issues that are the fault of pre-release code – RiggsFolly Aug 29 '20 at 16:34
  • I used the password that I created for root. It was a strong password with small, capital letters, numbers and special characters and easy to remember. And if I try logging without a password, I get a bunch of errors like `Cannot log in to the MySQL server` `mysqli_real_connect(): (HY000/1045): Access denied for user 'phpmyadmin'@'localhost' (using password: YES)` `Connection for controluser as defined in your configuration failed` `mysqli_real_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: NO)`. all at once :-(. what do you think I should do... – Agent Pluton Aug 29 '20 at 16:38
  • Sorry, its 7.4, my bad. I wrote it by mistake.. – Agent Pluton Aug 29 '20 at 16:40
  • But you ar logging in with `phpMyAdmin` as the userid as denoted by the error message `Access denied for **user** 'phpmyadmin'@'localhost'` – RiggsFolly Aug 29 '20 at 16:41
  • IDK, I wrote `root` in the the username section.... not phpmyadmin – Agent Pluton Aug 29 '20 at 16:46
  • Please read [Under what circumstances may I add “urgent” or other similar phrases to my question, in order to obtain faster answers?](//meta.stackoverflow.com/q/326569) - the summary is that this is not an ideal way to address volunteers, and is probably counterproductive to obtaining answers. Please refrain from adding this to your questions. – halfer Aug 31 '20 at 22:14

4 Answers4

5

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');
alper
  • 2,919
  • 9
  • 53
  • 102
5

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!

xicocaio
  • 867
  • 1
  • 10
  • 27
  • doesn't solve on my ubuntu 20.04 (after _do-release-upgrade_ from 18.04, and mariadb 10.3.38 ! – bcag2 May 26 '23 at 20:09
1

I had a similar issue with mysql 8.0.22 and Ubunutu 20.04.3lts after installation despite setting up the phpmyadmin user during the installation it wouldn't let me in with the password I set.

I solved it by logging in at the command line using

sudo mysql

Then changed the password by the below and I could then log in

ALTER USER 'phpmyadmin'@'localhost' IDENTIFIED BY 'new-password-here';
Dharman
  • 30,962
  • 25
  • 85
  • 135
c7borg
  • 339
  • 3
  • 9
0

I had the same problem by changing the password of the root user and the problem was solved by changing the content of the config.inc.php file inside the xampp\phpMyAdmin folder. Open the file with Notepad, then enter the defined password in front of the password field and that's it

Error image ---The part where the password must be entered

Vahid TG
  • 1
  • 1
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jan 30 '23 at 05:12