Soniya Wadhwa

Soniya Wadhwa

  • NA
  • 46
  • 32.7k

MySQL Database Backup using Mysqldump

Apr 6 2009 3:41 PM

Hello,

I m using MySQL Admin to take my database (MySQL) backup daily. MySql Admin attaches the date time to the file.

There is no way to compress the backup file using MySQL Admin.

I planned to do it through command line (using mysqldump) so tried to create a batch file (doing backup and compress the file) and automate it using schedule task.

But there is no password. How do i manage that.

But how do i attach a timestamp to my backup file in command line. Else it will overrite the existing file and i cannot have backup everyday.

Here is the code for my bacth file

mysqldump -u root -p DBName > xyz.sql

gzip -9 xyz.sql

Once i execute this on command prompt it asked me for password. i dont have any password. So i have to click enter and the it starts working.

how do i automate my daily backup on command line.

Is there any other way to take MySql database backup ?

Thanks in advance,

Soniya.

 

 

 


Answers (2)