I\'m setting up a new server and keep running into this problem.
When I try to login to the MySQL database with the root user, I get the error:
I would suggest to remove the Mysql connection -
UPDATE-This is for Mysql version 5.5,if your version is different ,please change the first line accordingly
sudo apt-get purge mysql-server mysql-client mysql-common mysql-server-core-5.5 mysql-client-core-5.5
sudo rm -rf /etc/mysql /var/lib/mysql
sudo apt-get autoremove
sudo apt-get autoclean
And Install Again But this time set a root password yourself. This will save a lot of effort.
sudo apt-get update
sudo apt-get install mysql-server