encounter mysql problem when trying to install php5.6 along with php7.0

Setting up mysql-server-5.7 (5.7.19-0ubuntu0.16.04.1) … Renaming
removed key_buffer and myisam-recover options (if present) dpkg: error
processing package mysql-server-5.7 (–configure): subprocess
installed post-installation script returned error exit status 1 dpkg:
dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.7; however: Package
mysql-server-5.7 is not configured yet.

dpkg: error processing package mysql-server (–configure): dependency
problems – leaving unconfigured

The above is from apt’s log after I run

sudo apt-get install php5.6

I was following the instructions on this page(https://lornajane.net/posts/2016/php-7-0-and-5-6-on-ubuntu) to install php5.6 on my machine, which already has php7.0 installed. I got a message saying I need to run dpkg --configure -a, and the following is what I got:
enter image description here

There seems to be a version conflict of mysql. I ran mysql_upgrade --force but it didn’t help.

So at this point how do I get my php5.6 installed? Will uninstalling mysql 5.7.19 help?