mysql:第1行出现DELIMITER语法错误 [英] mysql: DELIMITER syntax error at line 1

查看:911
本文介绍了mysql:第1行出现DELIMITER语法错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在phpmyadmin/MySQL中使用以下SQL添加此功能

I try to add this function using the following SQL in phpmyadmin/MySQL

DROP FUNCTION IF EXISTS `__myv`;
DELIMITER ;;
CREATE   FUNCTION `__myv`(`a` int, `b` int) RETURNS bigint(20)
BEGIN

    return FLOOR(a / b);
END;;
DELIMITER ;

但我收到此错误:

错误

SQL query:

DELIMITER;

MySQL said: Documentation
#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 'DELIMITER' at line 1 

如何解决此错误?

推荐答案

即使DELIMITER是控制台命令,phpMyAdmin的import模块也已经接受了很多年.当打开数据库并单击SQL时,在那里输入的查询将传递到导入模块,因此它应该可以工作(除非您有非常旧的phpMyAdmin版本).

Even if DELIMITER is a console command, phpMyAdmin's import module has accepted it since many years. When opening a database and clicking on SQL, a query entered there is passed to the import module, so it should work (unless you have a very old phpMyAdmin version).

这篇关于mysql:第1行出现DELIMITER语法错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆