解決Ubuntu 18.04 以上,安裝mysql之後不能用phpmyadmin登入root問題

sudo mysql -u root -p  
#先登入mysql

SELECT user,plugin,host FROM mysql.user WHERE user = 'root';  
#看一下,會看到auth_socket屬性

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your pass'; 
#改成你要登入phpmyadmin root 的密碼

FLUSH PRIVILEGES;

完成,現在已經可以用phpmyadmin登入了

參考文章:
https://devanswers.co/phpmyadmin-access-denied-for-user-root-localhost/