The problem is due to the socket authentication being enabled for the root user by default when there is no password set, while the upgrade to ubuntu 16.04.
The solution will be to revert back to native password authentication. You can do this by logging in to the MySQL using socket authentication by doing:
sudo mysql -u root
Once logged in:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
It would return back to the native (old default) password authentication.
Then you can use "password" as the password whenever required by MySQL.
Want to be a SQL expert? Come and join this SQL training and Certification by Intellipaat.