Documentation Home
MySQL 8.0 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 41.0Mb
PDF (A4) - 41.0Mb
PDF (RPM) - 39.4Mb
HTML Download (TGZ) - 9.3Mb
HTML Download (Zip) - 9.3Mb
HTML Download (RPM) - 7.9Mb
Man Pages (TGZ) - 260.6Kb
Man Pages (Zip) - 371.7Kb
Info (Gzip) - 3.9Mb
Info (Zip) - 3.9Mb
Excerpts from this Manual DROP FUNCTION Statement for User-Defined Functions


This statement drops the user-defined function (UDF) named function_name. (DROP FUNCTION is also used to drop stored functions; see Section 13.1.29, “DROP PROCEDURE and DROP FUNCTION Statements”.)

DROP FUNCTION is the complement of CREATE FUNCTION. It requires the DELETE privilege for the mysql system schema because it removes the row from the mysql.func system table that registers the function.

DROP FUNCTION also removes the function from the Performance Schema user_defined_functions table that provides runtime information about installed UDFs. See Section, “The user_defined_functions Table”.

During the normal startup sequence, the server loads UDFs registered in the mysql.func table. Because DROP FUNCTION removes the mysql.func row for the dropped function, the server does not load the function during subsequent restarts.

DROP FUNCTION cannot be used to drop a UDF that is installed automatically by components or plugins rather than by using CREATE FUNCTION. Such a UDF is also dropped automatically, when the component or plugin that installed it is uninstalled.


To upgrade the shared library associated with a UDF, issue a DROP FUNCTION statement, upgrade the shared library, and then issue a CREATE FUNCTION statement. If you upgrade the shared library first and then use DROP FUNCTION, the server may unexpectedly shut down.