备份mysql函数和存储过程
时间:2021-07-01 10:21:17
帮助过:168人阅读
DEFINER
=`test`@`
%`
PROCEDURE `prop_make_bak_sql`(psShecmal
varchar(
30),psFunctions
varchar(
3000))
BEGIN
select CONCAT(
‘-- 备份 ‘,name,
‘ \r\nDELIMITER $$\r\n \r\nCREATE OR REPLACE ‘,type,
‘ ‘,name,
‘(‘,
CAST(param_list
AS CHAR(
50000)
CHARACTER SET utf8),
‘) ‘ ,
if(type
=‘FUNCTION‘,
‘ RETURNS ‘,
‘‘),
if(type
=‘FUNCTION‘,
CAST(`
RETURNS`
AS CHAR(
50000)
CHARACTER SET utf8),
‘‘),
‘ \r\n‘,
CAST(body
AS CHAR(
500000)
CHARACTER SET utf8),
‘$$\r\n \r\nDELIMITER ;\r\n \r\n‘) tt
from mysql.
proc where db
= psShecmal
and FIND_IN_SET(
LOWER(name),
LOWER(psFunctions))
>0;
END
备份mysql函数和存储过程
标签:col mysql 备份mysql end nbsp rac weight -- utf8