我正在使用以下 sql:
I am using the following sql:
DELIMITER $$
DROP PROCEDURE IF EXISTS `get_auto_increment_settings`$$
CREATE PROCEDURE `get_auto_increment_settings`()
BEGIN
select @@global.auto_increment_offset as 'offset', @@global.auto_increment_increment as 'increment' ;
END $$
DELIMITER ;
我将它存储在 db_auto_increment_settings_procedure.sql 中,当我尝试从 ant 执行它时,我面临以下错误:
I stored this in db_auto_increment_settings_procedure.sql and when I am trying to execute this from ant, I am facing the following error:
[sql] Executing resource: /mysql/install/db_auto_increment_settings_procedure.sql
[sql] Failed to execute: DELIMITER
[sql] com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: 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
[sql] Failed to execute: DELIMITER ;
[sql] com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: 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
分隔符仅用于 mysql 客户端(不适用于 API、驱动程序等).
所以,这行不通.
The delimiter is used only by mysql client (not on API, driver ... etc).
So, it won't work.
查看您的错误消息:-
[sql] Executing resource: /mysql/install/db_auto_increment_settings_procedure.sql
[sql] Failed to execute: DELIMITER
很确定这将在 linux 系统中工作
Pretty sure this will work in linux system
mysql -u root -pxxx -h yyy < YOUR_SQL.sql
如果适用,您只需使用 mysql 客户端手动创建存储过程,
并且是一个没有汗水的解决方案.
If applicable, you just manually create the stored procedure using mysql client,
and is a no-sweat solution.
如果你需要动态创建这个,
该文档可能会提供一些见解信息
http://dev.mysql.com/doc/refman/5.0/en/connector-j-usagenotes-basic.html
If you need to create this dynamically,
this doc might provide some insight information
http://dev.mysql.com/doc/refman/5.0/en/connector-j-usagenotes-basic.html
这篇关于MySql 中的 DELIMITER 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
如何有效地使用窗口函数根据 N 个先前值来决定How to use windowing functions efficiently to decide next N number of rows based on N number of previous values(如何有效地使用窗口函数根据
在“GROUP BY"中重用选择表达式的结果;条款reuse the result of a select expression in the quot;GROUP BYquot; clause?(在“GROUP BY中重用选择表达式的结果;条款?)
Pyspark DataFrameWriter jdbc 函数的 ignore 选项是忽略整Does ignore option of Pyspark DataFrameWriter jdbc function ignore entire transaction or just offending rows?(Pyspark DataFrameWriter jdbc 函数的 ig
使用 INSERT INTO table ON DUPLICATE KEY 时出错,使用 Error while using INSERT INTO table ON DUPLICATE KEY, using a for loop array(使用 INSERT INTO table ON DUPLICATE KEY 时出错,使用 for 循环数组
pyspark mysql jdbc load 调用 o23.load 时发生错误 没有合pyspark mysql jdbc load An error occurred while calling o23.load No suitable driver(pyspark mysql jdbc load 调用 o23.load 时发生错误 没有合适的
如何将 Apache Spark 与 MySQL 集成以将数据库表作为How to integrate Apache Spark with MySQL for reading database tables as a spark dataframe?(如何将 Apache Spark 与 MySQL 集成以将数据库表作为