How can we drop a MySQL stored procedure?

MySQLMySQLi Database

If we have ALTER ROUTINE privileges for the procedure then with the help of DROP PROCEDURE statement we can drop a MySQL stored procedure. To demonstrate it, we are dropping a stored procedure named ‘coursedetails’ as follows −

mysql> DROP PROCEDURE coursedetails;
Query OK, 0 rows affected (0.68 sec)

The above query will drop the procedure named ‘coursedetails’. It can be confirmed by running the statement SHOW CREATE PROCEDURE which will return an error because the procedure does not exist.

Published on 21-Feb-2018 14:45:29