Re-Allowing ‘root’ access to PhpMyAdmin in newer versions of MySQL (or MariaDB)

In newer versions of MySQL (or MariaDB) the ‘root’ user can no longer connect remotely to the database server via PhpMyAdmin (and other such tools). After searching and finding a few backwards and complicated solutions there is actually a simpler way, very simple in fact. In just 3 quick steps.

Step 1
Connect to the database server as root in a terminal and use the database ‘mysql’:

mysql -u root -p mysql

Step 2
Change the value of ‘plugin’ for the user ‘root’ in the table called ‘users’ to emtpy:

MariaDB [mysql]> update user set plugin='' where user='root';

Step 3
Flush priveles and you’re good to go:

MariaDB [mysql]> flush privileges;

If you want to go back to disabling root access from anything other than the shell, you can follow the sames steps, but in step 2 change the ‘plugin’ value to “unix_socket”:update user set plugin='unix_socket' where user='root';