MySQL Database Backup Only 20 Bytes?

MySQL database backup only 20 bytes? Eek! That’s an empty backup. Here’s how to fix it if that happens to you.

I updated all my cPanel passwords following the hacking last week. A tedious thing to do when you have a lot of sites, but worth doing from time to time.

However, there was a problem. After the password changes I realised that my automatic backup was registering just 20 bytes (i.e. nothing in there) for all of my MySQL databases.

The databases hold things like sales data for my PLR articles sites, customers’ download links, all the posts on my niche blogs … important stuff. So I wouldn’t want to be unable to back them up.

It took me a lot of internet searching to find fixes, but once found, they were very easy.

1. Easy fix for 20 byte MySQL database backup problem

This worked for 95% of my sites.

  • Log into your cPanel
  • Click on ‘MySQL Databases’ (not the wizard, the other one)
  • Select the database(s) and click on ‘Repair Database’
  • Run your backup again.

In a few cases you might still only have 20 bytes. If so, try this:

2. Slightly more complex fix

  • In cPanel main menu, click on File Manager.
  • Run a search for a file called my.cnf (it is usually in a folder called /etc)
  • If you have the file, open it up with the edit option. You’ll probably see that it still has an old cPanel password in there. Update it with your current password and save. BUT don’t overwrite the database password if that’s in there, unless you changed that too.
  • Run backup again.

Note: Don’t include in your password any special characters that have a meaning in html (e.g. # !) because they may be read as html commands in my.cnf.

If you don’t have my.cnf, you might need to create one. But the above 2 options plus dealing with special characters solved all of the MySQL database backup only 20 bytes problems for me, so I can’t tell you how to do that. Look for some sample my.cnf files online maybe?


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Searching...