I have been trying to install phpmyadmin on my digitalocean droplet using ubuntu 14.04 / mysql 5.7.12 . I have a LAMP stack with apache as the web server.
During instal
Our server config - Debian 8.x Mysql 5.7 PHP 5+7 Apache 2.4
This should work :
If they don't exist, manually create them and GRANT phpmyadmin user all privileges on phpmyadmin table.
manually edit /etc/dbconfig-common/phpmyadmin.conf so as it reflects your current mysql server setup
dbc_dbserver = 'your_server'
dbc_dbport = 'your_mysql_port'
and any dbc_ fields that you feel need completion at this time
/etc/phpmyadmin/config-db.php
so as it reflects your current mysql server setup$dbserver = same_as_above
$dbport = your_mysql_listening_port
etc. - any other fields that you feel needs completing.
run dpkg-reconfigure phpmyadmin
from console with root or administrative privileges
choose Reinstall database for phpmyadmin - YES !!
when configuration window asks what you want to do with existing configuration file, choose - "Keep the local version currently installed".
In the console output you shouldn't have any mysql empty port errors anymore.
That worked for me.