Unable to login to phpmyadmin with the root user

Solution 1:

You have to reconfigure phpmyadmin, 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. 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

Wish it helps!

Have a nice day!

Solution 2:

I encountered a similar problem in Ubuntu 14.04 using MariaDB. Instead of trying to change everything I just created a new user.

mysql -u root -p

Entered the root password Created a new user using the following command:

CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'some_very_complex_password';

Granted all permissions to newuser:

GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost';
FLUSH PRIVILEGES;

You can then log on using newuser in phpMyadmin. I would strongly encourage you to only grant specific privileges to newuser instead of Carte Blanche privileges but it's your own funeral.

Solution 3:

To log in as root in phpmyadmin:

echo "UPDATE mysql.user SET plugin = 'mysql_native_password' WHERE user = 'root' AND plugin = 'unix_socket';FLUSH PRIVILEGES;" | mysql -u root -p

Found at the end of this tutorial

Worked for me :)

Solution 4:

By "rootuser" you mean the MySQL root user, not the system root user, right?

During the installation of mysql-server, the MySQL root account is created and its password is stored in /etc/mysql/debian.cnf.

The configuration files of phpMyAdmin are stored in /etc/phpmyadmin.