Failed to perform full MySQL database backup

capflam

Registered
Jan 12, 2013
2
0
1
cPanel Access Level
Website Owner
Hi,

My backup logs say that "Failed to perform full MySQL database backup" and I am not sure how to solve this issue.
There is a forum on my server, which databse is pretty large, about 2Gb and obviously I want to secure backups that are not going to be a problem is I need to restore.

The error is like this:
[cpbackup] Starting full MySQL database backups
/bin/gtar: Removing leading `/' from member names
/bin/gtar: /var/lib/mysql/mysql.sock: socket ignored
/bin/gtar: /var/lib/mysql/my_database_name/thread.MYD: file changed as we read it
[cpbackup] Failed to perform full MySQL database backup

Can someone explain or help in any way? I've been searching for an answer but found nothing...

Thanks
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
Hello :)

Could you check to see if the database mentioned with "file changed as we read it" in the backup log is corrupted? You can use a command such as:

Code:
# mysqlcheck database_name
Thank you.
 

capflam

Registered
Jan 12, 2013
2
0
1
cPanel Access Level
Website Owner
Hi Michael,

My admins had already performed a mysqlcheck and there doesn't seem to any corruption.
The backup doesn't seem to fail every time, only "most of the time". For instance on Monday there was no mention of the failed MySQL backup in the logs.

Any idea what would cause this and how to fix it? Please let me know.

Thanks
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
Hello :)

This error occurs when the database is updating and changing the file on disk at the same time as gtar (the compression program) is reading the same file.

This behavior is an unavoidable side effect of creating a compressed backup of the entire MySQL directory. It's always preferred to create backups via mysqldump, and mysqldumps are stored in each user's backup files. You may want to modify your backup configuration so that "Backup SQL Databases" is set to "Per Account Only".

Thank you.