使用mysqlhotcopy 对mysql进行备份
在数据库段分配一个专门用于备份的用户
mysql> grant select,reload,lock tables on *.* to 'hotcopyer'@'localhost' identified by '123456';
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;Query OK, 0 rows affected (0.00 sec)
3、在/etc/my.cnf里面添加
[mysqlhotcopy]
interactive-timeout
user=hotcopyer
password=123456
port=3306
开始备份。
[root@localhost ~]# mysqlhotcopy t_girl t_girl_new
Locked 4 tables in 0 seconds.
Flushed tables (`t_girl`.`category`, `t_girl`.`category_part`, `t_girl`.`id`, `t_girl`.`parent`) in 0 seconds.
Copying 22 files...
Copying indices for 0 files...
Unlocked tables.
mysqlhotcopy copied 4 tables (22 files) in 5 seconds (5 seconds overall).