Mysql Backup Batch Script

Reply

Join Date: May 2008
Posts: 51
Reputation: santhanalakshmi is an unknown quantity at this point 
Solved Threads: 0
santhanalakshmi santhanalakshmi is offline Offline
Junior Poster in Training

Mysql Backup Batch Script

 
0
  #1
Jun 11th, 2009
Hi,
This was Mysql Backup Batch Script

Script named as mysqlbackup.bat

REM [at] echo off

for /f "tokens=1" %%i in ('date /t') do set DATE_DOW=%%i

for /f "tokens=2" %%i in ('date /t') do set DATE_DAY=%%i
for /f %%i in ('echo %date_day:/=-%') do set DATE_DAY=%%i
for /f %%i in ('time /t') do set DATE_TIME=%%i
for /f %%i in ('echo %date_time::=-%') do set DATE_TIME=%%i

"C:\Program Files\xampp\mysql\bin\mysqldump" -u root -p jee > "C:\Program Files\xampp\mysql\bin\%DATE_DAY%_%DATE_TIME%_jee10.sql"




Its working fine.I have scheduled this mysqlbackup.bat file in
start -> control panel -> scheduled task ->Add ->daily.

Its all fine.Getting backup also correctly.


My main problem is:

Every time ,it asks the password to enter (while running mysqlbackup.bat file).

Can any one help me out from this.password should not ask when my script is running daily.



with regards,
santhanalakshmi.
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 798
Reputation: pritaeas is on a distinguished road 
Solved Threads: 130
Sponsor
pritaeas's Avatar
pritaeas pritaeas is offline Offline
Master Poster

Re: Mysql Backup Batch Script

 
0
  #2
Jun 12th, 2009
Your problem might be the space between -p and your password.

The command i use is this one
  1. mysqldump --host=localhost --user=pritaeas --password=blergh --all-databases --single-transaction --quick
"If it is NOT source, it is NOT software."
-- NASA
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 51
Reputation: santhanalakshmi is an unknown quantity at this point 
Solved Threads: 0
santhanalakshmi santhanalakshmi is offline Offline
Junior Poster in Training

Re: Mysql Backup Batch Script

 
0
  #3
Jun 15th, 2009
Originally Posted by pritaeas View Post
Your problem might be the space between -p and your password.

The command i use is this one
  1. mysqldump --host=localhost --user=pritaeas --password=blergh --all-databases --single-transaction --quick

Hi,

I did not set any password to the mysql.Default password "no password".Please see through it
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 798
Reputation: pritaeas is on a distinguished road 
Solved Threads: 130
Sponsor
pritaeas's Avatar
pritaeas pritaeas is offline Offline
Master Poster

Re: Mysql Backup Batch Script

 
0
  #4
Jun 18th, 2009
Originally Posted by santhanalakshmi View Post
Hi,
I did not set any password to the mysql.Default password "no password".Please see through it
If you have no password set, then remove the "-p jee" from the command line.
"If it is NOT source, it is NOT software."
-- NASA
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 51
Reputation: santhanalakshmi is an unknown quantity at this point 
Solved Threads: 0
santhanalakshmi santhanalakshmi is offline Offline
Junior Poster in Training

Re: Mysql Backup Batch Script

 
0
  #5
Jun 19th, 2009
Originally Posted by pritaeas View Post
If you have no password set, then remove the "-p jee" from the command line.


jee is the database name.
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 798
Reputation: pritaeas is on a distinguished road 
Solved Threads: 130
Sponsor
pritaeas's Avatar
pritaeas pritaeas is offline Offline
Master Poster

Re: Mysql Backup Batch Script

 
0
  #6
Jun 25th, 2009
then remove -p
"If it is NOT source, it is NOT software."
-- NASA
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 10
Reputation: davidn is an unknown quantity at this point 
Solved Threads: 2
davidn davidn is offline Offline
Newbie Poster

Re: Mysql Backup Batch Script

 
0
  #7
Jun 25th, 2009
To clarify a little, you are getting a password prompt because you are specifying -p which is normally used as -p[password] but you are not supplying a password after the -p so it prompts you for one. Removing the -p will get rid of the prompt.
http://www.raima.com for all your embedded and real-time database needs.
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 51
Reputation: santhanalakshmi is an unknown quantity at this point 
Solved Threads: 0
santhanalakshmi santhanalakshmi is offline Offline
Junior Poster in Training

Re: Mysql Backup Batch Script

 
0
  #8
Jun 26th, 2009
Originally Posted by davidn View Post
To clarify a little, you are getting a password prompt because you are specifying -p which is normally used as -p[password] but you are not supplying a password after the -p so it prompts you for one. Removing the -p will get rid of the prompt.

hi,
removing -p -its working fine for the root user.But at the same time ,While running Mysql Backup Batch File for the san user ,it asks password to enter.I set the password as "secret" for the san user.Please see through it and give me a valuable solution.


Thanks in advance.......................
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 798
Reputation: pritaeas is on a distinguished road 
Solved Threads: 130
Sponsor
pritaeas's Avatar
pritaeas pritaeas is offline Offline
Master Poster

Re: Mysql Backup Batch Script

 
0
  #9
Jun 26th, 2009
  1. "C:\Program Files\xampp\mysql\bin\mysqldump" -u san -psecret > "C:\Program Files\xampp\mysql\bin\%DATE_DAY%_%DATE_TIME%_jee10.sql"
"If it is NOT source, it is NOT software."
-- NASA
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the MySQL Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC