How do I Use mysqldump on a LAMP Server Running Plesk?

Plesk has some baked in magic concerning MySQL and the admin account. If you try to use mysql or 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 my do?

[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.

Leave a Reply

Follow TheNubbyAdmin!

follow us in feedly

Raw RSS Feed:

Contact Me!

Want to hire me as a consultant? Have a job you think I might be interested in? Drop me a line:

Contact Me!

Subscribe via Email

Your email address is handled by Google FeedBurner and never spammed!

The Nubby Archives

Circle Me on Google+!

Photos from Flickr

Me on StackExchange

The IT Crowd Strava Group

%d bloggers like this: