环境说明:
1.操作系统:
aaa@ubuntu:~$ cat /etc/issue
Ubuntu 12.04.3 LTS \n \l
2.内核版本:
aaa@ubuntu:~$ uname -a
Linux ubuntu 3.2.0-23-generic #36-Ubuntu SMP Tue Apr 10 20:39:51 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
3.Mysql的客户端工具:SQLyogEn
昨天测试服务器重启,mysql不能正常启动,后来由于业务的需要将内网的数据库迁移到测试服务器上,在还原数据库时报错如下:aaa@ubuntu:~/sql$ mysql -uroot -p'12345678'
ERROR 1418 (HY000) at line 2945731: 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)报错原因:开启bin-log
解决方法:编辑主配置文件/etc/my.cnf,将如下3行注释掉
#log-bin=mysql-bin
#binlog_format=mixed
#server-id = 1