linux系统中,配置文件路径一般为/etc/my.cnf
[root@host ~]# mysql --help|grep my.cnf
order of preference, my.cnf, $MYSQL_TCP_PORT,
/etc/mysql/my.cnf /etc/my.cnf ~/.my.cnf
[root@host ~]# cat /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
secure_auth=1 //1 允许导出导出 0 禁止导出导出
secure_file_priv=/var/lib/mysql/mysql-file //导入导出目录
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
federated
临时开启事件
SET
GLOBAL
event_scheduler =
ON
;
永久开启
在my.cnf中的[mysqld]部分添加如下内容:
event_scheduler=ON