一启用增量备份
1.1启用binlog
binlog_format=mixed
log_bin=/data/log/bin_log.log
expire_logs_days=7
max_binlog_size =500M
binlog-do-db=db
2 重启mysql服务
查看binlog
mysql> show binary logs;
mysql> show master status ;
mysql> show binlog events in 'bin_log.000003';
3 编写存储过程
drop procedure if exists pro_test;
CREATE DEFINER=`snowhill`@`%` PROCEDURE `pro_test`()
begin
declare i int;
set i=0;
while i<100 do
insert into T(id,name) values(i,'value');
set i=i+1;
end while;
end;
call pro_test();
select * from T;
4性能测试mysqlslap
测试500并发
mysqlslap -a -c 500 -i 10 -uroot -p123456
测试基本写入:
mysqlslap --auto-generate-sql -u root -p123456
其原理就是建一个两个字段的表,然后insert 数据测试.
use `mysqlslap`; CREATE TABLE `t1` (intcol1 INT(32) ,charcol1 VARCHAR(128))