【MySQL】ERROR 1418 This function has none of DETERMINISTIC, NO SQL, ...
【問題描述】:
在mysql建立function時經常出現的一個報錯,
原因是開啟了binary log,而且建立的函式沒有指定如下之一的引數。
DETERMINISTIC
READS SQL DATA
NO SQL
其完整報錯是:
ERROR 1418 (HY000) : 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)
【解決方案】:
其解決辦法,只要將log_bin_trust_function_creators設定為1即可。
log_bin_trust_function_creators引數是一個全域性變數,只能用
SET @@GLOBAL.log_bin_trust_function_creators = 1; 這類global方式設定其值,該值為布林型別:
故1、ON、TRUE同義,同樣0、OFF、FALSE同義。
這個引數在開啟二進位制日誌時被應用,它認為儲存函式的建立者必須為可信任的,反之寫入二進位制日誌將認為是不安全的。
該引數預設為0,除非使用者有SUPER許可權,此外還需有CREATE ROUTINE和ALTER ROUNTINE許可權,才可建立和修改儲存函式。
如果設定為1,mysql不會強制有哪些建立限制,這個引數同樣適用於TRIGGER的建立。
作者微信公眾號(持續更新)
在mysql建立function時經常出現的一個報錯,
原因是開啟了binary log,而且建立的函式沒有指定如下之一的引數。
DETERMINISTIC
READS SQL DATA
NO SQL
其完整報錯是:
ERROR 1418 (HY000) : 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)
【解決方案】:
其解決辦法,只要將log_bin_trust_function_creators設定為1即可。
log_bin_trust_function_creators引數是一個全域性變數,只能用
SET @@GLOBAL.log_bin_trust_function_creators = 1; 這類global方式設定其值,該值為布林型別:
故1、ON、TRUE同義,同樣0、OFF、FALSE同義。
Command-Line Format | --log-bin-trust-function-creators | ||
System Variable Name | log_bin_trust_function_creators | ||
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values | |||
Type | boolean | ||
Default | FALSE |
這個引數在開啟二進位制日誌時被應用,它認為儲存函式的建立者必須為可信任的,反之寫入二進位制日誌將認為是不安全的。
該引數預設為0,除非使用者有SUPER許可權,此外還需有CREATE ROUTINE和ALTER ROUNTINE許可權,才可建立和修改儲存函式。
如果設定為1,mysql不會強制有哪些建立限制,這個引數同樣適用於TRIGGER的建立。
作者微信公眾號(持續更新)
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29773961/viewspace-1876828/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- ERROR 1418 (HY000): This function has none of DETERMINISTIC, NO SQL,ErrorFunctionNoneSQL
- This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its de 錯誤解決辦法FunctionNoneSQL
- This function has none of DETEMINISTIC,NO SQL錯誤解決辦法FunctionNoneSQL
- Oracle Deterministic FunctionOracleFunction
- deterministic function 函式索引Function函式索引
- ORACLE FUNCTION函式中DETERMINISTIC測試OracleFunction函式
- mysql資料匯入問題處理(ERROR 1418 (HY000))MySqlError
- An out of memory error has occurred.Error
- 【Mysql】Last_SQL_Error: 1594MySqlASTError
- An internal error has occurred. Java heap spaceErrorJava
- 使用自定義函式創Function-Based Indexes時需要使用DETERMINISTIC Functions!函式FunctionIndex
- mysql執行函式出現1418錯誤MySql函式
- MySQL server has gone awayMySqlServerGo
- DBMS_UTILITY.FORMAT_ERROR_BACKTRACE FunctionORMErrorFunction
- error: ‘PATH_MAX’ undeclared (first use in this function)ErrorFunction
- error: use of deleted function ‘YYSTYPE::YYSTYPE()’[解決]ErrordeleteFunction
- 【Mysql】Slave_SQL_Running: No:Last_Error: Error :1032/1062MySqlASTError
- innobackupex:Error:xtrabackup child process has died at /usr/bin/innobackupexError
- An unexpected error has been detected by Java Runtime EnvironmentErrorJava
- The server has encountered an error while loading an applicationServerErrorWhileAPP
- an error has occurred. - no valid devices were found...Errordev
- The connection to adb is down, and a severe error has occured.Error
- An error has occurred when creating this preference page.Error
- 函式DETERMINISTIC函式
- serverless Error: getaddrinfo ENOTFOUND Function.doRequestServerErrorFunction
- MySQL create function時報錯MySqlFunction
- ORA-15186: ASMLIB error function = [asm_open], error = [1]ASMErrorFunction
- mysql-SQL Error: 1205, SQLState: 41000MySqlError
- PL/SQL 06 函式 functionSQL函式Function
- SQL 自定義函式FUNCTIONSQL函式Function
- Thread 1: Fatal error: init(coder:) has not been implementedthreadError
- 'oracle.sysman.emcp.oms.OmsPlugIn has failed' Error [ID 436605.1]OraclePluginAIError
- 問題MySQL server has gone awayMySqlServerGo
- "Fatal error: Call to undefined function: file_put_contents()"ErrorUndefinedFunction
- [HP-UX] ERROR: Function activate_volume_groupUXErrorFunction
- DETERMINISTIC Functions (203)Function
- SQL Error (1130): Host IP is not allowed to connect to this MySQL serverErrorMySqlServer
- 異常 This application has no explicit mapping for /error so yAPPError