I have been trying to install phpmyadmin on my digitalocean droplet using ubuntu 14.04 / mysql 5.7.12 . I have a LAMP stack with apache as the web server.
During instal
I solved this after I added passwords to both 'mysql' root and 'mysql' user. If you leave one or both of the two empty, you can do:
sudo -i
check:
whoami
if 'root', type:
mysql
, or mysql -u root -p
in case you already had a password for the root.
mysql terminal opens; then I added the passwords:
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH my_sql_native_password BY 'newpassword';
And/or the same for 'user' if needed. Then once I made the passwords for my user in MySQL and phpMyAdmin identical, I was done.
Before adding the passwords I applied @William Ardilla's as well as @user5781956's advice. Perhaps only @William Ardilla's is enough.