Cannot log into phpMyAdmin as the root user, When login is not being done with the password given by PHPMyAdmin and login with the same password in the command prompt. how to fix it? login to PHPMyAdmin with the root user-
These instructions are intended specifically for solving the error: Login without a password is forbidden by configuration (see AllowNoPassword).
Method 1:
if PHPMyAdmin does not login follow these steps
Step 1: Ctrl + Alt + T to launch terminal
Step 2: Connect to MySQL:- “sudo mysql -p -u root;”
Step 3: Create a user for phpMyAdmin, Run the following commands (replacing “password” by the desired password):
Run below command:-
“CREATE USER ‘pmauser’@’localhost’ IDENTIFIED WITH mysql_native_password BY ‘password’;“
Step 4: Allow remote connections (Optional and unsafe):
Remember: allowing a remote user to have all privileges is a security concern and this is not required in most of cases. With this in mind, if you want this user to have the same privileges during remote connections, additionally run (replacing “password” with the password used in Step #3):
Run below command:-
ALTER USER ‘root’@’localhost’ IDENTIFIED WITH mysql_native_password BY ‘password’;
FLUSH PRIVILEGES;
exit;
Step 5: Restart apache server “sudo systemctl restart apache2;”
Step 6: Then login to the PHPMyadmin server as root and set up the credentials you wish to have for the users. Open the PHPMyAdmin URL in your browser “http://www.domainname.com/phpmyadmin”
User Name: “root”
Password: “Password” (The password used in Step #3)
Method 2:
You have to reconfigure PHPMyAdmin and reset MySQL password.