paip. mysql如何临时 暂时 禁用 关闭 触发器

作者Attilax ,  EMAIL:1466519819@qq.com 

来源:attilax的专栏

地址:http://blog.csdn.net/attilax

MYSQL下如何禁用触发器。类似在SQL SERVER的alter table 表名 disable trigger 触发器名称。

查看MYSQL的ALTER TABLE语法,没有发现这样的功能。既然MYSQL自身不提供,我们就通过变通的办

法来实现。

解决方法:使用全局变量.

------------------------

 SET @distrig=0; 

select  @distrig;

触发器:

begin

 if @distrig!=1 then

insert  logx(idop,eventx,timex,demo,hezi,pyold,pynew)values( old.id,'update rec',now

(),'',old.hezi,old.atian,new.atian);

end if;

end

在MySQL存储过程变量前加@符号代表会话变量,作用域是当前登陆的帐户,DECLARE申明的变量只在

存储过程内部有效。

参考

mysql下如何禁用触发器-909413335-ChinaUnix博客.htm

MySQL存储过程变量前@的含义_Cisco技术 无忧网客联盟.htm

MySQL 运行期间暂时禁用触发器_哥只是个过客_百度空间.htm

paip. mysql如何临时 暂时 禁用 关闭 触发器的更多相关文章

  1. PAIP.MYSQL SLEEP 连接太多解决

    PAIP.MYSQL SLEEP 连接太多解决 作者Attilax  艾龙,  EMAIL:1466519819@qq.com  来源:attilax的专栏 地址:http://blog.csdn.n ...

  2. paip.mysql 性能跟iops的以及硬盘缓存的关系

    paip.mysql 性能跟iops的以及硬盘缓存的关系 作者Attilax  艾龙,  EMAIL:1466519819@qq.com  来源:attilax的专栏 地址:http://blog.c ...

  3. paip.mysql 性能测试 报告 home right

    paip.mysql  性能测试 报告 home right 作者Attilax  艾龙,  EMAIL:1466519819@qq.com  来源:attilax的专栏 地址:http://blog ...

  4. paip.mysql 性能测试by mysqlslap

    paip.mysql 性能测试by mysqlslap   作者Attilax  艾龙,  EMAIL:1466519819@qq.com  来源:attilax的专栏 地址:http://blog. ...

  5. paip.mysql 批量kill 连接.

    paip.mysql 批量kill 连接. 作者Attilax  艾龙,  EMAIL:1466519819@qq.com  来源:attilax的专栏 地址:http://blog.csdn.net ...

  6. paip.mysql 全文索引查询空白解决

    paip.mysql 全文索引查询空白解决   或者  Incorrect key file for table: \'%s\'. Try to repair it    作者Attilax  艾龙, ...

  7. paip.mysql fulltext 全文搜索.最佳实践.

    paip.mysql fulltext 全文搜索.最佳实践.  作者Attilax  艾龙,  EMAIL:1466519819@qq.com  来源:attilax的专栏 地址:http://blo ...

  8. paip.mysql 5.6 安装总结

    paip.mysql 5.6 安装总结 作者Attilax ,  EMAIL:1466519819@qq.com  来源:attilax的专栏 地址:http://blog.csdn.net/atti ...

  9. paip.mysql备份慢的解决

    paip.mysql备份慢的解决.txt 作者Attilax ,  EMAIL:1466519819@qq.com  来源:attilax的专栏 地址:http://blog.csdn.net/att ...

随机推荐

  1. LINUX关闭防火墙(转载)

    (1) 重启后永久性生效: 开启:chkconfig iptables on 关闭:chkconfig iptables off (2) 即时生效,重启后失效: 开启:service iptables ...

  2. easyui源码翻译1.32--ComboTree(树形下拉框)

    前言 扩展自$.fn.combo.defaults和$.fn.tree.defaults.使用$.fn.combotree.defaults重写默认值对象.下载该插件翻译源码 树形下拉框结合选择控件和 ...

  3. 161. One Edit Distance

    题目: Given two strings S and T, determine if they are both one edit distance apart. 链接: http://leetco ...

  4. 应付分配集 Distribution Sets

    (N) AP > Setup > Invoice > Distribution Sets (定义分配集) You can use a Distribution Set to auto ...

  5. C#中的深拷贝与浅拷贝

    1.基本的概念: 首先我们应该了解一下什么叫深拷贝与浅拷贝(Deep Copy and Shallow Copy). a.浅拷贝(Shallow Copy影子克隆):只复制对象的基本类型,对象类型,仍 ...

  6. BZOJ3585: mex

    3585: mex Time Limit: 20 Sec  Memory Limit: 128 MBSubmit: 322  Solved: 169[Submit][Status] Descripti ...

  7. POJ2236 Wireless Network 并查集

    水题 #include<cstdio> #include<cstring> #include<queue> #include<set> #include ...

  8. POJ --- 3613 (K步最短路+矩阵快速幂+floyd)

    Cow Relays   Description For their physical fitness program, N (2 ≤ N ≤ 1,000,000) cows have decided ...

  9. 【转】centos 6.4 samba 安装配置

    关掉防火墙     service iptables stop  chkconfig iptables off (永久关闭防火墙) 关闭SELinux vi /etc/sysconfig/selinu ...

  10. 【HTML】Beginner8:Table

    1.Table     Abused to lay out pages    The correct use for tables is to do exactly what you would ex ...