You haven't told us which OS you are using. But since you've already mentioned apt-get then I'll assume that you're using something similar to Ubuntu or Debian. These have a relatively similar configuration setup.
The package php-mysql should be dependent on php7.2-mysql or similar so firstly check that this is installed eg:
dpkg --list | grep '...
Configure/create a /root/.my.cnf file and put the following contents:
Then re-run the installation process. The issue is that phpmyadmin is attempting to log in to your mysql server and you have not provided a username/password to the phpmyadmin install script. Check the PMA documentation on where to configure ...