mysql触发器出现错误,怎么解决?
createtriggerscafterupdateontab1foreachrowbeginUPDATEtab1SETtab1_id=8WHEREtab1_id=1en...
create trigger sc
after update on tab1
for each row
begin
UPDATE tab1 SET tab1_id=8 WHERE tab1_id=1
end;
#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 'end' at line 6
问题出在那啊 ? 展开
after update on tab1
for each row
begin
UPDATE tab1 SET tab1_id=8 WHERE tab1_id=1
end;
#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 'end' at line 6
问题出在那啊 ? 展开
- 你的回答被采纳后将获得:
- 系统奖励15(财富值+成长值)+难题奖励30(财富值+成长值)
推荐于2016-09-01
展开全部
解决方法如下:
1)导入数据的用户不仅需要CREATE ROUTINE, ALTER ROUTINE, CREATE TRIGGER, ALTER TRIGGER,
CREATE FUNCTION 和 ALTER FUNCTION 权限,还需要SUPER privileges 权限,使用超级用户导入数据。
2)让所有用户具有执行类似functions的权限,危险,不推荐,
o by specifying it on the server start, like: –log-bin-trust-function-creators=1
o by setting it to 1 through the SET GLOBAL statement, like:
mysql> SET GLOBAL log_bin_trust_function_creators = 1;
3)如果不需要复制,或者是从库,关闭binlog,
?
# binary logging – not required for slaves, but recommended
#log-bin=mysql-bin
# binary logging format – mixed recommended
#binlog_format=mixed
1)导入数据的用户不仅需要CREATE ROUTINE, ALTER ROUTINE, CREATE TRIGGER, ALTER TRIGGER,
CREATE FUNCTION 和 ALTER FUNCTION 权限,还需要SUPER privileges 权限,使用超级用户导入数据。
2)让所有用户具有执行类似functions的权限,危险,不推荐,
o by specifying it on the server start, like: –log-bin-trust-function-creators=1
o by setting it to 1 through the SET GLOBAL statement, like:
mysql> SET GLOBAL log_bin_trust_function_creators = 1;
3)如果不需要复制,或者是从库,关闭binlog,
?
# binary logging – not required for slaves, but recommended
#log-bin=mysql-bin
# binary logging format – mixed recommended
#binlog_format=mixed
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
sql语句后面加分号
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询