this can also happen when upgrading from 14.04 to 16.04, which causes an unsupported mysql upgrade (5.5 -> 5.7), which is not a supported upgrade path as documented by mysql. The easiest way around this is to upgrade mysql to 5.6 whilst still under 14.04. You achieve this by first (of course!) dumping all your databases;
hostname # mysqldump --lock-all-tables -u root -p --all-databases > backup.sql
then upgrading to mysql 5.6;
hostname # apt-get install mysql-server-5.6 mysql-client-5.6 mysql-server-core-5.6 mysql-client-core-5.6
This way, all your databases are upgraded in place and (on my machines so far) entirely safely and transparently to 5.6. The only issue after the upgrade may be TIMESTAMP entries. Now, even after an do-release-upgrade to 16.04, mysql is still left at 5.6 and the issues surrounding the non-supported upgrade from 5.5 directly to 5.7 during the release upgrade never even surface.
Hope this helps,
Kailee.