Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

windows batch file for mysqldump command

this is first time I am upto making a windows batch file.I wish not to do experiments first as its related to live server. I use to back up mySql database by following open cmd write

mysqldump -u user -p DBname >C:\DBname.sql

then cmd ask password

password = password

I want to make a windows batch file ,upon click I wish to perform the above functionality. Can any one please give some instructions related script of .bat file

So far I wrote this

ECHO OFF
mysqldump -u user -p DBname >C:\DBname.sql
GO
SET password = password 
Go

but still it prompts me for password . I wish password get enter automatically

like image 990
Learnner Avatar asked Jan 03 '13 13:01

Learnner


1 Answers

The above was still prompting me for a password I used whats below to get it to work correctly.

"C:\Program Files (x86)\MySQL\MySQL Server 5.5\bin\mysqldump.exe" -uroot -pDBPass DBName > C:\DBname.sql
like image 62
Sean409 Avatar answered Oct 21 '22 12:10

Sean409