|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Here is the error code:
Error Code : 1295 This command is not supported in the prepared statement protocol yet (0 ms taken) This is my procedure. Any is appreciated. DELIMITER $$ DROP PROCEDURE IF EXISTS `david_test`.`sp_grant_privileges_on_routine`$$ CREATE PROCEDURE `david_test`.`sp_grant_privileges_on_routine`( IN f_db varchar(255), IN f_user varchar(255)) BEGIN declare i int default 0; set @stmt = concat('select count(1) from mysql.proc where db = ''',f_db,''' into @cnt'); prepare s1 from @stmt; execute s1; deallocate prepare s1; while i < @cnt do set @stmt = concat('select `name` from mysql.proc where db = ''',f_db,''' limit ',i,'1 into @name'); prepare s1 from @stmt; execute s1; deallocate prepare s1; set @stmt = concat('grant execute on ',f_db,'.',@name,' to ',f_user); prepare s1 from @stmt; execute s1; deallocate prepare s1; set i = i + 1; end while; flush privileges; END$$ DELIMITER ; -- I'm a mysql DBA in china. More about me just visit here: http://yueliangdao0608.cublog.cn |
|
![]() |
| Outils de la discussion | |
|
|