View Single Post
Old 10-03-2017, 07:19 AM  
Barry-xlovecam
It's 42
 
Industry Role:
Join Date: Jun 2010
Location: Global
Posts: 18,083
SSH

Warning Will Robinson: Use mysql as root user so you can lock the tables

make a directory for your mysql backups
cd to that directory you make

Code:
#!use root to locktables
$ mysqldump --add-drop-table  -u root  -p [DATABASE NAME] >[DATABASE NAME].backup.$(date +%F).sql
Enter password:
/home/user/****.com/****/[DATABASE NAME].backup.2017-09-24.sql
is made^^
use scp or rsync to move the backup to other locations

You will have to

create the database user and grant permissions as needed

CREATE [DATABASE NAME];

then read this
https://stackoverflow.com/questions/...-line-in-mysql
Barry-xlovecam is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote