Category Archives: mysql

backup mysql databases

By | September 8, 2015

steps to perform mysql databases backup: put the server  in a read-only state: FLUSH TABLES WITH READ LOCK; SET GLOBAL read_only = ON; backup data via this script or: mysqldump -h host_name –user=user_name –password=password –events –opt –single-transaction db_for_backup | gzip > backup_name.gz turn off read-only mode: SET GLOBAL read_only = OFF; UNLOCK TABLES; to restore db from… Read More »

mysql_backup_by_db.sh

By | September 8, 2015

#!/bin/bash read -e -p “Type host for backup, followed by [ENTER]: ” -i “127.0.0.1” host read -e -p “Type username for $host, followed by [ENTER]: ” -i “root” user read -e -p “Type password for $user, followed by [ENTER]: ” -i “” passwd read -e -p “Database which should be backuped [ENTER]: ” -i “all”… Read More »