26

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?

Community
  • 1
  • 1
MikkoP
  • 4,864
  • 16
  • 58
  • 106

1 Answers1

45

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?

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.

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 procedures and post2: Drop all stored procedures in MySQL or using temporary stored procedures.

Community
  • 1
  • 1
bonCodigo
  • 14,268
  • 1
  • 48
  • 91
  • With this one I get `PROCEDURE does not exist`. When I'm trying to create one, it says the same. When I try to use it, it says the procedure doesn't exist. – MikkoP Jan 01 '13 at 11:56
  • @MikkoP I have updated the answer by adding additional routines you could try out. Please give a shot and comment. – bonCodigo Jan 01 '13 at 12:31