rk13
10/17/2015 - 8:15 PM

Mysql maintenance

Mysql maintenance


mysql -u root -p

FLUSH TABLES WITH READ LOCK;
SET GLOBAL read_only = ON;
EXIT

mysqldump --lock-all-tables -u root -p --all-databases > dump.sql

scp dump.sql user@mysql_1_private_IP:/tmp

SET GLOBAL read_only = OFF;
UNLOCK TABLES;