mysql - Work around lesser privileges -
whenever run code:
set global log_bin_trust_function_creators=true; drop function if exists greatercirclenm; delimiter go create function greatercirclenm( lat1 float, lon1 float, lat2 float, lon2 float ) returns float begin declare pi, q1, dist float; set pi = pi(); set lat1 = lat1 * pi / 180; set lon1 = lon1 * pi / 180; set lat2 = lat2 * pi / 180; set lon2 = lon2 * pi / 180; set q1 = acos(sin(lat1)*sin(lat2)+cos(lat1)*cos(lat2)*cos(lon1-lon2)); set dist = q1*180*60/pi; return dist; end; go delimiter ;
i error telling me don't have super privileges. hosting provider told me not possible me (1) privileges or (2) have them run code. leaves me option (3) remove set global log_bin_trust_function_creators=true;
while still creating function. i'm not sure if possible, i'd appreciate help.
you can't set global
without super privilege.
cf. http://dev.mysql.com/doc/refman/5.6/en/set-statement.html
the super privilege required set global variables.
you can't set session
variable:
mysql> set session log_bin_trust_function_creators=0; error 1229 (hy000): variable 'log_bin_trust_function_creators' global variable , should set set global
this confirmed documentation lists variable global only, not session based.
so no, can't work around this. you'll have ask provider create function if don't want give super privilege.
or else different hosting plan provider allows super privilege.
or else don't calculation in sql stored function.
Comments
Post a Comment