How to log into MySQL as root user in Plesk

Plesk-LogoYou may have noticed that there is no MySQL root user on servers running Plesk. That’s because Plesk renames this user into “admin” by default – for security reasons.

The password for the admin MySQL account is the same as for the Plesk Panel admin account.

Even so, when you try to login to MySQL – remotely or locally – you may be puzzled to find that your admin password doesn’t seem to work. Let me assure you of your sanity and your keyboard skills: it’s because Plesk encrypts the password in the database.

It is the encrypted version that you must present to MySQL, not the clear version. For example, if your password was indeed “password”, then the following command will not grant you access to MySQL:

You can check your unencrypted password by issuing the following command (on Linux servers):

In our example, it will indeed show “password” – so why doesn’t it work? It’s because that command will unencrypted the password for us. MySQL however needs the encrypted version. Here’s how we can extract this from Plesk:

This will give you a weird looking output as shown above. Believe it or not, that’s your MySQL admin password!

If you’re already logged into your server as root and want to issue a MySQL shell command, you can login to MySQL like so:

If you’re attempting a remote connection to MySQL then simply paste that cryptic looking password you got in the earlier step.

About Jay Versluis

Jay is a medical miracle known as a Super Survivor. He runs two YouTube channels, five websites and several podcast feeds. To see what else he's up to, and to support him on his mission to make the world a better place, check out his Patreon Campaign.

1 thought on “How to log into MySQL as root user in Plesk

  1. If your memory is a bitch, like mine use this to access directly:

    root@server:[~]: cat /etc/psa/.psa.shadow

    root@server:[~]: cat /root/.my.cnf

    root@server:[~]: mysql

Add your voice!