Drop all stored procedures in MySQL or using temporary stored procedures

后端 未结 7 2055
逝去的感伤
逝去的感伤 2020-12-13 20:39

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

7条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-13 20:49

    I would have thought that this would do it, but I'm open to corrections:

    (EDITED to incorporate a good point provided in the comments)

    delete from mysql.proc WHERE db LIKE ;
    

    (As pointed out by Balmipour in the comments below, it's a good idea to specify the database.)

    I think it's valid to want to drop all procedures in a given database, otherwise in a long development cycle there's a danger of obsolete procedures and functions accumulating and muddying everything up.

提交回复
热议问题