338 Part III . Administration Performing Database Backups As part of my consulting for business database systems, I once received an emergency call from a new client who had the unfortunate incident that everyone fears: A hard drive failure. The client and I tried desperately to recover the drive, even working with the manufacturer. It became evident that no amount of effort to recover the drive was going to bring it back to life. The obvious next step to get their business back online was to restore from backup. I ll never forget the pause when I said, It appears we ll need to restore from backup. The client had no backup of the drive thus no backup of the database. The previous scenario is all too common. No backups are done to critical data and no extra copies are stored, even on the same disk. When something catastrophic happens, the hard drive and all the data on it can be lost. With the client, we eventually sent the hard drive back to the manufacturer and they were able to perform expensive data recovery. The client ended up with a week s worth of downtime and a large bill from the hard drive manufacturer for data recovery. This section examines some tools for making backups of the data within MySQL. These tools include mysqlhotcopy, mysqldump, and the BACKUP TABLE statement. mysqlhotcopy The program mysqlhotcopyis the MySQL AB recommended method for backing up a database. With mysqlhotcopyyou can make a backup of a live database and have the results copied to another directory. The mysqlhotcopyprogram is actually written in Perl so be sure to have Perl and its related MySQL-Perl libraries installed. As with all programs, mysqlhotcopy has its limitations: . It presently supports only cp. Therefore mysqlhotcopydoesn t copy the resulting file to another server. However, this function can be added (along with other methods) for ensuring the storage of the backup in a different location. . It can run only on the actual database server. An administrator must connect to the database server to run the command, or schedule it with a scheduling program such as cron. Caution Because mysqlhotcopy uses the cp command, it cannot run on Microsoft Windows platforms such as Windows 2000. Should you want more information on the mysqlhotcopy command (and you don t have this book available), you can run the following command: perldoc mysqlhotcopy
If you are looking for cheap and quality webhost to host and run your website check Jboss Web Hosting services.