Plesk has some baked in magic concerning MySQL and the admin account. If you try to use
mysqldump using your root user name or password, it will not be allowed. You’ll see something like this:
[root@server] mysql -u admin -p ERROR 1045 (28000): Access denied for user 'admin'@'localhost' (using password: YES)
If you want to access MySQL as root, you simply use the command
my. What exactly does
[root@server] type my my is aliased to `mysql -A -u admin -p`cat /etc/psa/.psa.shadow`'
So, in order to use mysqldump, one has to use the following command syntax:
mysqldump -u admin -p`cat /etc/psa/.psa.shadow` [database] > [outfile-name]
Strange but true. Of course, this is for a vanilla installation of Plesk. I’m sure you can customize your MySQL permissions and groups to behave differently, however I would not advise that. Plesk likes to have things its own way, and it will either break if you change things or set things back to how it likes them on the next update.