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 2021-06-29 17:26:51,715 [E] ranger_core_db_mysql.sql file import failed! 2021-06-29 17:26:51,716 [I] Unable to create DB schema, Please drop the database and try again 2021-06-29 17:26:51,716 [JISQL] /usr/java/jdk1.8.0_181-cloudera/bin/java -cp /usr/share/java/mysql-connector-java.jar:/opt/ranger/ranger-2.1.0-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://172.x.x.x/ranger -u 'rangeradmin' -p '********' -noheader -trim -c \; -query "delete from x_db_version_h where version = 'CORE_DB_SCHEMA' and active = 'N' and updated_by='pro10.vpc.example.com';" Tue Jun 29 17:26:51 CST 2021 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification. 2021-06-29 17:26:52,364 [E] CORE_DB_SCHEMA import failed!
解决: 根据这里的解决方法,在文件/opt/ranger/ranger-2.1.0-admin/db/mysql/optimized/current/ranger_core_db_mysql.sql中加入SET GLOBAL log_bin_trust_function_creators = 1;即可解决。