It looks like dbconfig-common tried to execute the upgrade twice after the initial failure to connect to mysql:
applying upgrade sql for 5.0.1-1ubuntu1 -> 5.2.5-0ubuntu6.1. dbconfig-common: flushing administrative password applying upgrade sql for 5.0.1-1ubuntu1 -> 5.2.5-0ubuntu6.1.
It looks like dbconfig-common tried to execute the upgrade twice after the initial failure to connect to mysql:
applying upgrade sql for 5.0.1-1ubuntu1 -> 5.2.5-0ubuntu6.1.
dbconfig-common: flushing administrative password
applying upgrade sql for 5.0.1-1ubuntu1 -> 5.2.5-0ubuntu6.1.