MySQL配置文件以及服务的开启关闭重启

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

上一篇:centos7 安装搜狗输入法


下一篇:idea生成JAVADOC 报java.lang.IllegalArgumentException解决方案[终极]