Skip to content

Instantly share code, notes, and snippets.

View contao-db-update.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'];
SyZn / gist:9724977
Created Mar 23, 2014
Dump mysql with powershell
View gist:9724977
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
You can’t perform that action at this time.