| | |
Mysql Backup Batch Script
Please support our MySQL advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: May 2008
Posts: 51
Reputation:
Solved Threads: 0
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.
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.
Your problem might be the space between -p and your password.
The command i use is this one
The command i use is this one
MySQL Syntax (Toggle Plain Text)
mysqldump --host=localhost --user=pritaeas --password=blergh --all-databases --single-transaction --quick
"If it is NOT source, it is NOT software."
-- NASA
-- NASA
•
•
Join Date: May 2008
Posts: 51
Reputation:
Solved Threads: 0
•
•
•
•
Your problem might be the space between -p and your password.
The command i use is this one
MySQL Syntax (Toggle Plain Text)
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
•
•
Join Date: Jun 2009
Posts: 10
Reputation:
Solved Threads: 2
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.
•
•
Join Date: May 2008
Posts: 51
Reputation:
Solved Threads: 0
•
•
•
•
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.......................
MySQL Syntax (Toggle Plain Text)
"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
-- NASA
![]() |
Similar Threads
- Delete a directory using batch script (Legacy and Other Languages)
- Changing a background in a batch script (Windows NT / 2000 / XP)
- Closing batch script after .exe is called (Windows NT / 2000 / XP)
- Daily Auto MySQL Backup saved to directorty (MySQL)
- Batch Script - Error 7901??? (Windows NT / 2000 / XP)
Other Threads in the MySQL Forum
- Previous Thread: Need Help What is wrong on in this Trigger
- Next Thread: binary vs. link table vs. array
| Thread Tools | Search this Thread |
agplv3 alfresco amazon api artisticlicense bizspark breathalyzer camparingtocolumns changingprices cmg communityjournalism contentmanagement contractors copyright count court crm database design developer development distinct drupal dui ec2 email enterprise eudora facebook form foss gartner gnu government gpl greenit groklaw groupware hiring images innerjoins insert ip joebrockmeier join journalism keyword keywords laptop law legal license licensing linux maintenance managing mariadb matchingcolumns metron micromanage microsoft microsoftexchange mindtouch montywidenius mozilla multiple music mysql mysqlcolumnupdating mysqldatetimeordermax() mysqlindex mysqlinternalqueries mysqlquery mysqlsearch news open-xchange opendatabasealliance opengovernment opensource oracle penelope php priceupdating query referencedesign reorderingcolumns resultset saas select sharepoint simpledb sourcecode spotify sql sugarcrm syntax techsupport thunderbird transparency virtualization





