1. 程式人生 > 其它 >JumpServer安裝部署

JumpServer安裝部署

select *from k_type where FIND_IN_SET(pid,get_child_list('10'));

-- GROUP_CONCAT(id)

delimiter $$ 
-- drop function if exists get_child_list$$ 
create function get_child_list(in_id varchar(10)) returns varchar(1000) 
begin 
declare ids varchar(1000) default ''; 
declare tempids varchar(1000); 

set tempids = in_id; 
while tempids is not null do set ids = CONCAT_WS(',',ids,tempids); select GROUP_CONCAT(id) into tempids from k_type where FIND_IN_SET(pid,tempids)>0; end while; return ids; end $$ delimiter ; -- 如果出現錯誤就執行 set global log_bin_trust_function_creators=TRUE;

簡單記錄 首先最開始是查詢的語句 下面是一個函式方法 執行後會生成 當我們執行的時候出現錯誤要修改引數  下面set是臨時修改配置

 

    1. 在mysql資料庫中執行以下語句 (臨時生效,重啟後失效)
      set global log_bin_trust_function_creators=TRUE;

    2. 在配置檔案/etc/my.cnf的[mysqld]配置log_bin_trust_function_creators=1