数据库MySQL用函数操作开启、关闭、查看功能的方法
下面我们对MYSQL实际使用中,遇到的问题,给读者一个总结。给大家一个参考。
在运行mysql中,你或许会遇到此类错误,代码如下:
ERROR 1418 : 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)
这是因为MYSQL数据库没有开启的引起的。执行以下代码开启即可:
SET GLOBAL log_bin_trust_function_creators=1;
与之类似,关闭mysql函数的代码就是:
SET GLOBAL log_bin_trust_function_creators=0;
那么查看mysql状态的代码又是什么呢?代码如下:
show variables like '%func%';