Skip to content

Instantly share code, notes, and snippets.

@SyZn
SyZn / gist:9724977
Created March 23, 2014 15:49
Dump mysql with powershell
function dump-yourdb {
$command_pattern = "C:\path\to\mysqldump.exe -u {0} -p{1} --skip-extended-insert --skip-dump-date {2} -r {3}"
$command = $command_pattern -f '<username>','<password>','<database>','C:\path\to\dumpfile'
echo 'Executing: ' $command
Invoke-Expression $command
}
<?php
// assuming we are in a subfolder to root like 'scripts'
define('TL_ROOT', dirname(__DIR__));
require TL_ROOT . '/system/config/localconfig.php';
// Database credentials
$strHost = $GLOBALS['TL_CONFIG']['dbHost'];
$strUser = $GLOBALS['TL_CONFIG']['dbUser'];
$strPassword = $GLOBALS['TL_CONFIG']['dbPass'];