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.

Recommended Answers

All 8 Replies

Your problem might be the space between -p and your password.

The command i use is this one

mysqldump --host=localhost --user=pritaeas --password=blergh --all-databases --single-transaction --quick

Your problem might be the space between -p and your password.

The command i use is this one

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

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 you have no password set, then remove the "-p jee" from the command line.

jee is the database name.

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.

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.......................

"C:\Program Files\xampp\mysql\bin\mysqldump" -u san -psecret > "C:\Program Files\xampp\mysql\bin\%DATE_DAY%_%DATE_TIME%_jee10.sql"
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.