In Ubuntu 18.04 the version of MySQL that gets installed is designed so that the “root” user cannot log into phpMyAdmin as a default security measure. This is because everything comes with a “root” username and therefore it’s one less thing for a hacker to guess when breaking into your system.
In terms of security best practices, you should create a new user that has root privileges. Something obscure that also can’t be guessed. Thus making it substantially more difficult for attackers to access your system.
The instructions for the recommended method have been documented in this post: Cannot log into phpMyAdmin as root user