mysql触发器

触发器见识数据操作insert/update/delete
触发时间after/before
表关联操作有哪些insert/update/delete
show trigger \G;

delimiter

declare 变量名 变量类型 default 默认值

查看存储过程
show procedure status
create procedure p1()
begin
select * from goods;
declare age int default 10;
select concat('年龄是',age);
end$
show procedure \G
call prodecure()

show master status
show slave status
主从配置
start slave

主id
server-id=1
log-bin=mysql-bin
binlog-format=mixed/row/statment
从id
server-id=2
log-bin=mysql-bin
binlog-format=mixed
relay-log=mysql-relay

mysqld-safe --user=mysql &
service iptables status

grant replication client,replation slave on . to repl@'192.168.1.%' identified by 'repl';

权限回收
grant all on ecshop.* to lisi@'192.168.1.%';
revoke all on ecshop.* to lisi@'192.168.1.%';
grant insert,update,select on gys.goods to
lisi@'192.168.0.%';
从服务器执行
show master status
change master to master_host='192.168.1.1',master_user='repl',master_password='pass',master_log_file='mysql-bin.000001',master_log_pos=348;
从执行 start slave

主开复制账号 从使用账号
reset slave
start slave

你可能感兴趣的:(mysql触发器)