-- 查看是否开启创建函数的功能 show variables like '%func%'; -- 开启创建函数的功能 set global log_bin_trust_function_creators = 1; 然后在创建mysql自定义函数