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

查看:50
本文介绍了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 的导入模块也已经接受了很多年.打开数据库并单击 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天全站免登陆