List:General Discussion« Previous MessageNext Message »
From:Jerry Schwartz Date:January 29 2010 3:51pm
Subject:RE: how to dump database or tables
View as plain text  
>-----Original Message-----
>From: Anand kumar [mailto:anand.srm@stripped]
>Sent: Friday, January 29, 2010 4:36 AM
>To: Suresh Kuna
>Cc: muralikrishna g; mysql@stripped
>Subject: Re: how to dump database or tables
>
>it should be windows.. .
>
[JS] This will get you backed up...
=====
REM - This job compacts & zips the US MySQL databases
REM
REM - Parameterize the directory, to make it easier to change.
REM
REM - Create target zip files with a suffix of
REM   yymmdd_hhmmss, where yymmdd_hhmmss is a date_time stamp like 
030902_134200

SET todirname=c:\users\svadmin\documents\MySQL Backups

REM - Clean out any old zip files.

DEL /Q "%todirname%\*.zip"

SET hh=%time:~0,2%

REM - Since there is no leading zero for times before 10 am, have to put in
REM   a zero when this is run before 10 am.

IF "%time:~0,1%"==" " SET hh=0%hh:~1,1%
SET 
yymmdd_hhmmss=%date:~12,2%%date:~4,2%%date:~7,2%_%hh%%time:~3,2%%time:~6,2%

REM - Dump and zip the MySQL databases

SET dump_name=%yymmdd_hhmmss%_us_gii_mysql_backup

mysqldump [-h<host>] -p<password> -u<user> --all-databases | "C:\Program

Files\7-Zip\7z.exe" a "%todirname%\%dump_name%"  -si"%dump_name%"

=====

To restore the databases, you'll have to supply the archive name.
=====
"C:\Program Files\7-Zip\7z.exe" e <zip file name> | mysql 
[-h<host>] -p<password> -u<user> > reload_log.txt
=====

That should do you.

7-Zip is a free compression/decompression program for Windows.

Regards,

Jerry Schwartz
The Infoshop by Global Information Incorporated
195 Farmington Ave.
Farmington, CT 06032

860.674.8796 / FAX: 860.674.8341

www.the-infoshop.com






Thread
how to dump database or tablesmuralikrishna g29 Jan
  • Re: how to dump database or tablesSuresh Kuna29 Jan
    • Re: how to dump database or tablesAnand kumar29 Jan
      • Re: how to dump database or tablesWagner Bianchi29 Jan
      • RE: how to dump database or tablesJerry Schwartz29 Jan