Eu tive o mesmo problema (atualizei incorretamente o host do usuário do virtualmin) e corrigi-lo com etapas semelhantes à resposta do @techraf, mas seguindo etapas semelhantes deste site para evitar o erro can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'
no ubuntu 16.04:
link
Eu modifiquei as etapas para atualizar o host em vez da senha:
# Stop MySQL
sudo service mysql stop
# Make MySQL service directory.
sudo mkdir /var/run/mysqld
# Give MySQL user permission to write to the service directory.
sudo chown mysql: /var/run/mysqld
# Start MySQL manually, without permission checks or networking.
sudo mysqld_safe --skip-grant-tables --skip-networking &
# Log in without a password.
mysql -uroot mysql
então no mysql:
select user, host from mysql.user; --just to check
UPDATE mysql.user SET host='localhost' WHERE User='root' AND Host='202.54.10.20'; --CHANGE the host to the one you see in the query
select user, host from mysql.user; --check again
commit;
exit;
E depois no console:
# Turn off MySQL.
sudo mysqladmin -S /var/run/mysqld/mysqld.sock shutdown
# Start the MySQL service normally.
sudo service mysql start