How can I login to MySQL on Linux Plesk?

The following error appears while trying to login to MySQL prompt on Plesk from root user:

ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: NO)

This is because Plesk doesn’t allow root user to login to MySQL. Use admin user instead. Plesk stores the admin password in /etc/psa/.psa.shadow file. You can supply the admin password while connecting or pass the password directly as:

mysql -uadmin -p`cat /etc/psa/.psa.shadow`