Posted On March 31, 2019

Web Server Files and mySQL backup and restore

kimconnect 0 comments
blog.KimConnect.com >> Codes , Database >> Web Server Files and mySQL backup and restore
Backup:
mysqldump -u [username] -p [password] [databasename] > /home/shares/backup_db.sql
 
Restore:
mysql -u root -p sexcenter < /home/www/sexcenter/dump/g2_Entity_Original.sql
 
setup Cron Job:
# crontab -e
———-
@midnight /usr/bin/mysqldump –user=root –password=horse78 –all-databases > /home/alldatabases.sql

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

PowerShell: Find Locking PID of a File

$filePath="C:\Program Files\Google\Chrome\Application\chrome.exe" function findPidOfFile($filepath){ try{ if (!(Get-Command handle.exe -ErrorAction SilentlyContinue)) { if (!(Get-Command choco.exe -ErrorAction…

PowerShell: Scheduled Task to Backup Local Files to remote UNC Path

Set Script Execution Policy on Host PS H:\> Set-ExecutionPolicy RemoteSignedExecution Policy ChangeThe execution policy helps…

PowerShell: Get SQL Server Backup Statuses

$computername='sql01' function getSqlBackupInfo ($sqlInstanceName=$env:computername, $dbName){ [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo") $location=if($sqlInstanceName.Contains("`\")){ "SQLSERVER:\SQL\$sqlInstanceName\Databases" }else{ "SQLSERVER:\SQL\$sqlInstanceName\DEFAULT\Databases" } function getPacificTime($time){ if($time){ [System.TimeZoneInfo]::ConvertTimeBySystemTimeZoneId($time,'Pacific…