Created 03-18-2016 04:15 PM
Installing Ranger via Ambari on AWS, got this:
2016-03-18 16:10:44,048 [JISQL] /usr/jdk64/jdk1.8.0_60/bin/java -cp /usr/share/java/mysql-connector-java.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://mysqldb/ranger -u 'user' -p '********' -noheader -trim -c \; -input /usr/hdp/current/ranger-admin/db/mysql/patches/007-updateBlankPolicyName.sql
Error executing: CREATE FUNCTION `getTempPolicyCount`(assetId bigint, resId bigint) RETURNS int(11) BEGIN DECLARE tempPolicyCount int default 1; DECLARE dbResourceId bigint; DECLARE exitLoop int DEFAULT FALSE; DECLARE policyList CURSOR FOR SELECT id from x_resource where asset_id = assetId; DECLARE CONTINUE HANDLER FOR NOT FOUND SET exitLoop = true; OPEN policyList; readPolicy : LOOP FETCH policyList into dbResourceId; IF exitLoop THEN set tempPolicyCount = tempPolicyCount + 1; LEAVE readPolicy; END IF; IF (resId = dbResourceId) THEN LEAVE readPolicy; END IF; set tempPolicyCount = tempPolicyCount + 1; END LOOP; CLOSE policyList; RETURN tempPolicyCount; END java.sql.SQLException: This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable) SQLException : SQL state: HY000 java.sql.SQLException: This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable) ErrorCode: 1418 2016-03-18 16:10:44,438 [E] 007-updateBlankPolicyName.sql import failed!
Created 03-22-2016 06:52 PM
@Richard Xu - Can you please execute the below command in MySQL and retry the install?
SET GLOBAL log_bin_trust_function_creators = 1
If you'd like to roll back to the default value of 0, you can do that after the install goes through.
Created 03-18-2016 05:31 PM
It is Ambari 2.2.0.0, HDP-2.3.4.0-3485
Created 03-22-2016 02:27 AM
Can you please remove the hostname :). It is a security risk and customer may not like it.
Created 03-22-2016 06:52 PM
@Richard Xu - Can you please execute the below command in MySQL and retry the install?
SET GLOBAL log_bin_trust_function_creators = 1
If you'd like to roll back to the default value of 0, you can do that after the install goes through.
Created 05-02-2016 10:50 AM
I had the same error and I can confirm that above command fixed the issue. Thx!
Created 01-11-2017 01:39 PM
It worked for me as well.. Thanks.