Tag Archives: Batch

Automating MySql Scripts

So I needed to run a mysql script on a daily basis to do some maintenance on a database. Pretty straight forward davessql.sql:

davesbatch.bat

Then a scheduled task to call the batch file, job done.

Backing up mySQL Databases Batch File / Script

And another, this time to backup the databases, based on an earlier post or creating simple backups, I can then call this batch from within another batch file. @echo off IF %1.==. GOTO No1 ECHO Dave’s mySQL Database Backup UtilityECHO …

Read more »

mySQL Restore Batch File / Script

I got bored typing mysql commands so wrote a little script to keep on my box for easy access to restore databases from .sql files. It’s very simple and may not be any use to anyone. It also stores the …

Read more »

Simple Script to backup MySQL Databases

This is a simple script I use to backup MySQL databases. Save the following as backup.bat (or similar) and they you can set a scheduled task to run this daily. “C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqldump.exe” -uUSERNAME -pPASSWORD MYSQLDBNAME > “c:\folder\mysqldbname\mysqldbname_%time:~0,2%%time:~3,2%%time:~6,2%_%date:~-10,2%%date:~-7,2%%date:~-4,4%.sql” The …

Read more »

Using UNC paths in Batch files

I tend to write a lot of batch files, mostly for backing up this and that. When working with UNC paths you can sometimes encounter errors such as: Using xopy (c:\>xcopy \\server\path c:\path) tends to get around this, but sometimes …

Read more »

Hyper-V VM Backup Script Batch File

If you’re after a way to make good, non corrupt backups of your Hyper-V VM’s, and you after a way of doing it for free, then this script is what you want. This script will shut down your selected VM’s …

Read more »