日期:2014-05-16  浏览次数:20476 次

数据库结构版本控制

?

Help

./backup.mysql.struct.sh
Usage: ./backup.mysql.struct.sh {init|start|stop|status|restart}

Create backup user for your database.

CREATE USER 'backup'@'localhost' IDENTIFIED BY 'SaJePoM6BAPOmOFOd7Xo3e1A52vEPE';
GRANT SELECT, LOCK TABLES  ON *.* TO 'backup'@'localhost';
FLUSH PRIVILEGES;
SHOW GRANTS FOR 'backup'@'localhost';

Database connect infomation

BACKUP_HOST="localhost"
BACKUP_USER="netkiller"
BACKUP_PASS="chen"
BACKUP_DBNAME="test aabbcc"
BACKUP_DIR=~/backup

Initialize the working directory

$ ./backup.mysql.struct.sh init
Initialized empty Git repository in /home/neo/backup/.git/

Start

$ ./backup.mysql.struct.sh start

Stop