MySQL 删除程序哪个已经存在?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14110147/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Dropping procedure which already exists?
提问by MikkoP
Possible Duplicate:
Error with mysql procedures ERROR 1304 & ERROR 1305
I try to run a command to drop a procedure:
我尝试运行一个命令来删除一个过程:
DROP PROCEDURE create_datetable
By doing this I get the a warning:
通过这样做,我收到警告:
1304 PROCEDURE create_datetable already exists
After that when I'm trying to create a new procedure with the same name, I get the same warning.
之后,当我尝试创建具有相同名称的新过程时,我收到相同的警告。
What does this mean?
这是什么意思?
回答by bonCodigo
Reference: Drop Procedure.
参考:删除程序。
The code:
编码:
DROP PROCEDURE IF EXISTS procedureName;
...
Edit:
编辑:
Can you try to rename the procedure and then try to drop it as per this post: Rename a mysql procedure?
您能否尝试重命名该过程,然后尝试按照这篇文章删除它:重命名 mysql 过程?
try this:
尝试这个:
UPDATE `mysql`.`create_DataTable`
SET name = '<new_proc_name>',
specific_name = '<new_proc_name>'
WHERE db = '<database>' AND
name = '<old_proc_name>';
Also note: If have granted privileges to users for this procedure you will need to update the procedure name in newProcedure as well.
另请注意:如果已向用户授予此过程的权限,则还需要更新 newProcedure 中的过程名称。
UPDATE `mysql`.`create_DataTable`
SET Routine_name = '<new_proc_name>'
WHERE Db = '<database>' AND
Routine_name = '<old_proc_name>';
FLUSH PRIVILEGES;
Do you have the freedom to delete all procedures? If so please try out this post: Drop all stored procedures in MySQL or using temporary stored proceduresand post2: Drop all stored procedures in MySQL or using temporary stored procedures.
你有删除所有程序的自由吗?如果是这样,请尝试这篇文章:删除 MySQL 中的所有存储过程或使用临时存储过程和 post2:删除 MySQL 中的所有存储过程或使用临时存储过程。