Mysqldump/ Automating daily in windows

I need to do mysql backups on the server and store them in a location that is backed up daily. What is the command line prompt to do so in windows for mysqldump. Also, I need to have this done automatically daily. How do I go about doing so?
kbreaux25Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
adrpoConnect With a Mentor Commented:

You could use -r file, instead of the redirect:
It might works better.

mysqldump opt uUSERNAME -pPASSWORD DB NAME -r d:/pathname
Is actually recommended for windows. Read here:
http://dev.mysql.com/doc/refman/5.0/en/mysqldump.html#option_mysqldump_result-file

Cheers,
za-k/
0
 
michofreihaCommented:
In order to do that you should create a batch file where you'll put the following code:

mysqldump --opt -uUSERNAME -pPASSWORD DATABASE_NAME > "C:/path/to/dump/file.sql"

This batch file should be located in c:\path\to\mysql\bin
Regarding how to run it daily go to controlPanel-->Scheduled Tasks--> then add anew task and choose the date of running
0
 
kbreaux25Author Commented:
I can get the command to work if i dont specify a path and only the db.sql name for the output, but the command

mysqldump opt uUSERNAME -pPASSWORD DB NAME > "D:\pathname"

returns an error that it can't find the path specified
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
michofreihaCommented:
please let me know the full path o your MySQL which mean where is the mysql folder is located?
0
 
kbreaux25Author Commented:
mysql is located in c:\program files\mysql\mysql server5.0\bin. I need to put the backup file on a different drive that is backed up daily.
0
 
michofreihaCommented:
let's do a test before:

1- Start
2- Run and type cmd
3- cd c:\program files\mysql\mysql server5.0\bin
4- ./mysqldump --opt -uroot -pPassword Database_Name > "c:\program files\mysql\mysql server5.0\bin/dump.sql"

Please do that and let me know if dump.sql is created under the bin folder
0
 
kbreaux25Author Commented:
ran the command and returns couldnt find the path specified
0
 
michofreihaCommented:
are you sure that mysqldump figure in the bin folder?
0
 
kbreaux25Author Commented:
Yes when i type mysqldump ....command .. > dbname.sql. It successfully dumps the file to the bin directory, i just can't seem to be able to enter a path name.
0
 
kbreaux25Author Commented:
That seems to work. However I get an errcode 2 can't create file or directory when i try to put the file on the d drive but i can put it on the c drive. Perhaps something I should talk to the network guy about?
0
 
adrpoCommented:

Can you create files on d:\?
Do you have full permisions on this [network] drive?
0
All Courses

From novice to tech pro — start learning today.