ACarter
ACarter

Reputation: 5697

MySQL failing to log in for mysqldump

I'm trying to use mysqldump in my server, from the command line.

root@xxxxx:/xx/xx/xx/backups/09-03-13# mysqldump db_name_xxxx --tab=. --user=xxxx 
   --password=xxxxx
mysqldump: Got error: 1045: Access denied for user 'xxxxx'@'localhost' (using 
   password: YES) when executing 'SELECT INTO OUTFILE'

So I assume it's a problem with username/password.

However, I can get into the MySQL command line fine using mysql, with exactly the same logon details.

What could be causing mysqldump to fail, but not mysql?

Upvotes: 0

Views: 301

Answers (1)

Boris the Spider
Boris the Spider

Reputation: 61148

Your problem is not with the login details but with the user you are logging in as.

In order to carry out a mysqldump you need at least SHOW DATABASES, SELECT, LOCK privileges on every table in the database. Things get more complicated if you use more exotic options such as locking etc.

This is a faily good reference for what permissions you need for what options in mysqldump.

Upvotes: 1

Related Questions