《Mysql入门mysql如何设置job任务自动启动》要点:
本文介绍了Mysql入门mysql如何设置job任务自动启动,希望对您有用。如果有疑问,可以联系我们。
MYSQL数据库1,检查当前的job
MYSQL数据库mysql> use dev;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
MYSQL数据库Database changed
mysql> show events;
+-----+-------------+------------------+-----------+-----------+------------+----------------+----------------+---------------------+------+---------+------------+----------------------+----------------------+--------------------+
| Db | Name | Definer | Time zone | Type | Execute at | Interval value | Interval field | Starts | Ends | Status | Originator | character_set_client | collation_connection | Database Collation |
+-----+-------------+------------------+-----------+-----------+------------+----------------+----------------+---------------------+------+---------+------------+----------------------+----------------------+--------------------+
| dev | my_job_test | hxl@192.168.56.% | SYSTEM | RECURRING | NULL | 1 | DAY | 2014-03-07 18:10:00 | NULL | ENABLED | 0 | utf8 | utf8_general_ci | latin1_swedish_ci |
+-----+-------------+------------------+-----------+-----------+------------+----------------+----------------+---------------------+------+---------+------------+----------------------+----------------------+--------------------+
1 row in set (0.23 sec)
MYSQL数据库2,检查是否开启了自动启动
MYSQL数据库3,设置job自动启动
MYSQL数据库4,设置mysql重启后,job能自动启动
编辑/etc/my.cnf文件,在[mysqld]下添加event_scheduler=1
MYSQL数据库[root@node1 etc]# more my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
event_scheduler=1
MYSQL数据库[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
转载请注明本页网址:
http://www.vephp.com/jiaocheng/6174.html