Is there a statement that can drop all stored procedures in MySQL? Alternatively (if the first one is not possible), is there such thing as temporary stored procedures in My
@user1070300's answer seems to work, but it looks like it can drop a lot of things.
A quick DESC mysql.proc; led me to add a WHERE to my request, so as to spare already existing MySQL procedures, which I had, of course, no reason to drop.
I executed DELETE FROM mysql.proc WHERE db NOT LIKE 'mysql';
If you have several bases and want to target only one, use DELETE FROM mysql.proc WHERE db LIKE ' instead;
Btw, if like me, you are completely clearing your database and need to also drop your tables, you can use this linux shell script :
mysql -Nse 'show tables' DATABASE_NAME | while read table; do mysql -e "drop table $table" DATABASE_NAME; done
(see Truncate all tables in a MySQL database in one command? for more details)
Truncate all tables in a MySQL database in one command?