1
$d= Get-Date
$dString = $d.Year.ToString() + "-" + $d.Month.ToString() + "-" + $d.Day.ToString() + "_" + $d.Hour.ToString() + "-" + $d.Minute.ToString() + "-" + $d.Minute.ToString()
$backupFilePath = "C:\wamp\backupFileName_" + $dString + ".sql"
$cmd = "& 'C:\wamp\bin\mysql\mysql5.6.12\bin\mysqldump.exe' -u ipbform -p123123 wiki > " + $backupFilePath
Write-Host $cmd
invoke-expression $cmd | out-null

When I look at the MySQL dump file I get this:

ÿþ-(bunch of random symbols like its a compiled file)

1 Answer 1

3

ÿþ is the Byte Order Mark of a file encoded in little-endian Unicode format. Try this:

$cmd = "& 'C:\wamp\bin\mysql\mysql5.6.12\bin\mysqldump.exe' -u ipbform -p123123 wiki"
Write-Host $cmd
Invoke-Expression $cmd | Out-File $backupFilePath -Encoding ASCII
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.