use news;
  DELIMITER ;;
  create TRIGGER delete_categories_teigger
  after delete on categories
  for each row delete from newsinfo
  where
  newsinfo.CategoryID=OLD.CategoryID;;
  DELIMITER ;执行以上脚本以后出现错误:#1235 - This version of MySQL doesn't yet support 'multiple triggers with the same action time and event for one table' 
我的阿帕奇服务器是wamp5 1.74应该支持吧 ?如果不支持的话应该从何处着手?

解决方案 »

  1.   

      create table newsinfo (
      NewsID int(10) unsigned not null auto_increment comment '新闻编号',
      Title varchar(60) not null comment '新闻标题',
      IssueTime datetime not null default '0000-00-00 00:0000' comment '发布时间',
      Content longtext not null comment '新闻内容',
      CategoryID tinyint(6) unsigned not null comment '类别编号',
      Editor varchar(20) not null comment '编辑姓名',
      Source varchar(30) default null comment '新闻来源',
      primary key (NewsID)
     ) ENGINE=InnoDB DEFAULT CHARSET=GBK;
    不知道哦  我的newsinfo表是这么创建的,无内容。
      

  2.   

    use news;
      DELIMITER ;;
      create TRIGGER delete_categories_teigger
      after delete on categories
      for each row 
    begin
    delete from newsinfo where newsinfo.CategoryID=OLD.CategoryID;; 
    end;
      

  3.   

    #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 5 
    还是不行,又出现了错误。以上。
      

  4.   

    是不是版本的问题呀?我的版本是5.0.45 书上说mysql是从5.02版本起开始支持触发程序。
      

  5.   

    首先你说你的表里没有数据,那么请问你删除的又是什么?
    OLD指的是你删除掉的数据,既然你没有删除,那么你的OLD从何而来?
    你删除的数据记录是就是OLD,而你根本没有删除过,那么你又要查找出你删掉的这条记录,让这条记录的ID等于他自己的ID,
    这个逻辑也不通啊。。
      

  6.   


    错误提示已经很清楚了,你的这张表是已经有trigger了。
    用命令 SHOW TRIGGERS  找一下。
      

  7.   

    categories 表上是否有其它触发器?
      

  8.   

    比如有BEFORE DELETE TRIGGER
      

  9.   

    饿 show出来了  已经有一个trigger了 。不过我执行脚本的时候一直报错,不知道啥时候建上去的。