Unable to login to PHPMyAdmin with the root user

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.

  1. Reconfigure PHPMyAdmin
  2. Ctrl + Alt + T to launch terminal
  3. sudo dpkg-reconfigure PHPMyAdmin
  4. Connection method for MySQL database for PHPMyAdmin: unix socket
  5. Name of the database’s administrative user: root
  6. The password of the database’s administrative user: mysqlsamplepassword
  7. MySQL username for PHPMyAdmin: root
  8. MySQL database name for PHPMyAdmin: phpmyadmin
  9. Web server to reconfigure automatically: apache2
  10. ERROR 1045
  11. ignore
  12. sudo dpkg-reconfigure mysql-server-5.5
  13. New password for the MySQL “root” user: mysqlsamplepassword
  14. Repeat password for the MySQL “root” user: mysqlsamplepassword

Recent Post