Debian Allow MySQL root user to login using phpMyAdmin

On Debian/Ubuntu by default MySQL root user can only login from local accounts.

To enable login from phpMyAdmin, you need to set plugin to “mysql_native_password”.

To do this, login to MySQL as user root, then run

Configuring MySQL .my.cnf

Add following content

Replace DBPASSWORD with your MySQL root password.

Now set permission for this file to 600, so no user other than root can see it.