phpmyadmin

Can’t log into phpMyAdmin: mysqli_real_connect(): (HY000/1698): Access denied for user ‘root’@’localhost’

Can’t log into phpMyAdmin: mysqli_real_connect(): (HY000/1698): Access denied for user ‘root’@’localhost’

MySQL 5.7 and above

Creating a Superuser for phpMyAdmin

In terminal, log in to MySQL as root.

sudo mysql -p -u root
CREATE USER 'pmauser'@'localhost' IDENTIFIED BY 'password_here';

Now we will grant superuser privilege to our new user pmauser.

GRANT ALL PRIVILEGES ON *.* TO 'pmauser'@'localhost' WITH GRANT OPTION;

You should now be able to access phpMyAdmin using this new user account.