I got " Access denied for user 'phpmyadmin'@'localhost' " in the process of installing phpmyadmin in Ubuntu 16.04
Seems like your permissions aren't set right for root user or you have lost your MySQL root password.
I would try resetting MySQL password for root and trying again. I guess this is the fastest way. Follow these steps
Stop the mysql demon with this command
sudo /etc/init.d/mysql stop
Start the mysql demon process with following
sudo /usr/sbin/mysqld --skip-grant-tables --skip-networking &
(at this point it's safest to disable networking)
Start the mysql client with
mysql -u root
Then run following in mysql prompt, so you are able to change any password
Then reset password with
SET PASSWORD FOR root@'localhost' = PASSWORD('password');
In case you happen to have a mysql root account that can connect from everywhere, this is recommended
UPDATE mysql.user SET Password=PASSWORD('newpwd') WHERE User='root';
Once you receive a message indicating a succesful query, then run
Stop mysql and relaunch it with
sudo /etc/init.d/mysql stop sudo /etc/init.d/mysql start
I suppose you have these installed
web server apache
php_mysql support for apache
Instead of using root as user try phpmyadmin as the user name.
I had a similar problem signing into my phpmyadmin login page using root as the user, and knowing the password was correct.
I had the same access denied for user root @ localhost every time tried logging into phpmyadmin, so when I tried phpmyadmin as user name! and the password I finally managed to log into phpmyadmin