[英]mysql Trigger Issue “in wrong schema”
I am running我在跑步
delimiter //
create trigger beforeYourTableUpdate BEFORE UPDATE on YourTable
FOR EACH ROW
BEGIN
SET new.guid_column := (SELECT UUID());
END
//
delimiter; [edit]
UPDATE YourTable set guid_column = (SELECT UUID());
DROP TRIGGER beforeYourTableUpdate;
And everytime I run this - I get the error "Trigger in wrong schema" using MySQL 5.5每次我运行这个 - 我使用 MySQL 5.5 得到错误“在错误的架构中触发”
Any ideas why this would be?任何想法为什么会这样?
You have to add the schema you're working with.您必须添加您正在使用的架构。 On the top, add:在顶部,添加:
use 'yourWorkingSchema';
That should solve the problem.那应该可以解决问题。
You didn't reset the delimiter, you might want to add您没有重置分隔符,您可能需要添加
delimiter ;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.