Problem with Mysqldump

Status
Not open for further replies.

grandad

Member
I have a few Wordpress installations running and want to create a simple, reliable way of backing up the databases. For various reasons I have decided against plugins, and am using Cron.

I created a script which is called from Cron -
Code:
/usr/bin/mysqldump --host=hostserver --user=username --password=password database --quick > /usr/local/webspace/httpdocs/backups/backupdb-`date +%d.%m.%y`.sql

My problem is that this script works perfectly on two of the sites, but on the third it just produces an empty file.

The database sizes are 13.8 Mb, 3.4 Mb and 31.4 Mb, and it is the last one that is failing.

Has anyone got any ideas as to why one should fail when the other two work? Could the size be relevant?
 

mneylon

Administrator
Staff member
Size shouldn't be an issue.. it would be helpful if you had some errors to work with :)
 

grandad

Member
Not having terminal access to the server, I can't run the command directly. Forgive my ignorance but is there a way to dump errors etc to a file?

Problem Solved!

Through a lot of trial and error, found the problem - mysqldump didn't like some of the characters used in the database password. Set up a new user for the DB and the job is oxo. :eagerness:
 

mneylon

Administrator
Staff member
Ah - makes sense.. if the characters were a bit "odd" you might have had to escape them ..
 

grandad

Member
I tried that but the code bitched about the escape characters! I ended up creating a new database user with a password containing non-contentious characters. :congratulatory:
 

mneylon

Administrator
Staff member
I've always had problems with escaping characters - invariably I get it wrong ..
 
Status
Not open for further replies.
Top