我是靠谱客的博主 朴素哈密瓜,最近开发中收集的这篇文章主要介绍mysql触发器delimiter,MySQL DELIMITER语法错误,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

This MySQL script installs multiple triggers.

It works on one machine running MySQL 5.0.51b-community. On another machine running MySQL 14.12 Distrib 5.0.45, for redhat-linux-gnu (i386) it fails, with this error message, which seems to be related to the DELIMITER // ... // DELIMITER; syntax :

ERROR 1064 (42000) at line 272: 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 'DELIMITER; DROP TRIGGER IF EXISTS trigger_name; DELIMITER' at line 1

The script syntax (summarised) is:

DROP TRIGGER IF EXISTS trigger_name;

DELIMITER //

CREATE TRIGGER trigger_name BEFORE UPDATE ON table

FOR EACH ROW BEGIN

-- Trigger logic goes here

END //

DELIMITER;

-- More trigger drop/create statements follow

What is wrong with the script, and how can I correct it?

解决方案

Try

DELIMITER ;

not

DELIMITER;

You're actually specifying ; as an argument to the DELIMITER command, so not having the space there may be confusing it.

最后

以上就是朴素哈密瓜为你收集整理的mysql触发器delimiter,MySQL DELIMITER语法错误的全部内容,希望文章能够帮你解决mysql触发器delimiter,MySQL DELIMITER语法错误所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(51)

评论列表共有 0 条评论

立即
投稿
返回
顶部