Skip to main content
Question

Recommended way to backup MySQL that is running on Windows

  • June 17, 2026
  • 5 comments
  • 40 views

Forum|alt.badge.img+1

We’ve got an application that utilizes MySQL on Windows (Win 2025 OS). I’ve seen search entries on how to use Veeam pre- and post-processing scripts to properly backup MySQL, but those were all Linux-based OSes, and this app runs on MySQL for Windows. I tried searching the KB for MySQL on Windows guidance, and came up empty. Any have any info or guides on how best to do that? I mean, I could ask the vendor to just make a scheduled task to have MySQL export out an ASCII  copy of the DB, and I just backup the whole Windows VM like normal, and use the BAK that way, if we ever needed to do a restore or whatever.

5 comments

eblack
Forum|alt.badge.img+2
  • Influencer
  • June 17, 2026

MySQL isn’t VSS aware. You’ll need some pre/post freeze/thaw scripts for it. 

  • Keep backing up the whole Windows VM with Veeam.
  • Add a MySQL-native dump or physical backup before the Veeam job.
  • Store that dump somewhere inside the VM on a volume Veeam protects.

An example would look like - 

$ErrorActionPreference = "Stop"

$stamp = Get-Date -Format "yyyyMMdd-HHmmss"
$dumpDir = "D:\MySQLDumps"
$dumpFile = Join-Path $dumpDir "appdb-$stamp.sql"

New-Item -ItemType Directory -Force -Path $dumpDir | Out-Null

$mysqldump = "C:\Program Files\MySQL\MySQL Server 8.4\bin\mysqldump.exe"

& $mysqldump `
  --defaults-extra-file="C:\Scripts\mysql-backup.cnf" `
  --single-transaction `
  --quick `
  --routines `
  --events `
  --triggers `
  --hex-blob `
  --databases appdb `
  --result-file="$dumpFile"

if ($LASTEXITCODE -ne 0) {
    throw "mysqldump failed with exit code $LASTEXITCODE"
}

 

C:\Scripts\mysql-backup.cnf:

[client]
user=backup_user
password=your_password_here
host=localhost

 

There may be a another way to do this but this one does work fine for the purpose at hand unless its a very large DB, then restore time might come into play. 

 


Chris.Childerhose
Forum|alt.badge.img+22

It looks like the integration for the Veeam Agent is Linux only.  You need to do a dump like you mentioned to back up from the Windows box.

See here - MySQL | Veeam Backup & Replication Best Practice Guide


coolsport00
Forum|alt.badge.img+23
  • Veeam Legend
  • June 17, 2026

Good share Chris. I wasn’t aware of that for MySQL.

We actually do this for one of our DB servers, altho not MySQL. We configure the DB  to do a backup within the server, then simply do image-level (VM) backup of the server to get a Veeam backup of it, and do a DB backup file restore if needed. In the almost 14yrs I’ve been here, we’ve thankfully only needed to use an intra-OS DB backup file once. Works good. 


Forum|alt.badge.img+1
  • Author
  • Comes here often
  • June 17, 2026

We’re mostly a Microsoft SQL shop. And I kind of insist that my DBA implement Maintenance Plans using SQL Server Agent (to be fair, I didn’t have to insist, he knows enough that is what you need to do). In our case, the scheduled plan exports the DB in a BAK format to a network share (and only keeps the last xx copies, so it doesn’t eat up all the space). And I set up Veeam to backup that network share.

 

So basically I’ll be setting up an effectively similar situation for my MYSQL application, just using the OS Scheduled Tasks and the above Powershell script to emulate the SQL Server Agent task. I have  script that cleans up files, so I’ll run that after the MySQL export, so we manage disk space, as well.


coolsport00
Forum|alt.badge.img+23
  • Veeam Legend
  • June 17, 2026

Good one there ​@MikeLeone 👍🏻