问题1: 
    Mysql是安装在linux体统中,操作是通过使用WindowsXP 下的软件Navicat 8 for MySQL,在连接上Linux中的数据库之后,打开了我使用的库,然后在事件中增加了一个事件,在事件的计划任务中,勾选了Every 1 Hour, Starts 2010-07-14 10:00:00。这个计划任务主要是调用了一个存储过程,存储过程语句如下:
    begin
    delete from GJ_VEH1L where JGSJ < date_sub( now(),  interval 3 month) order by JGSJ;
    delete from GJ_VEH1L_BACK where JGSJ < date_sub( now(),  interval 3 month) order by JGSJ;
    end
症状是,有的机器突然就不执行这个计划任务了,求解决方法及可能原因。问题2:
    在Linux系统中 配置 /etc/my.cnf文件,在【mysqld】下 加入了如下代码:
    
    log=/data/GKJManager/mysql_log/log.log
    slow-query-log_file=/data/GKJManager/mysql_log/slow-query-log.log
    log-error=/data/GKJManager/mysql_log/log-err.log
    log-queries-not-using-indexes = /data/GKJManager/mysql_log/nouseindex.log    希望能够打开 我计划任务执行时的日志,但是加了如下代码之后,在/data/GKJManager/mysql_log这个文件夹中,只产生了log-err.log,而且貌似只生成了 我输入service mysql restart 之后的错误信息,错误信息如下:120917 11:41:11 mysqld_safe mysqld from pid file /usr/local/mysql/data/localhost.localdomain.pid ended
120917 11:41:12 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
120917 11:41:12 [Warning] /usr/local/mysql/bin/mysqld: ignoring option '--log-queries-not-using-indexes' due to invalid value '/data/GKJManager/mysql_log/nouseindex.log'
120917 11:41:12 [Note] Plugin 'FEDERATED' is disabled.
120917 11:41:12  InnoDB: Started; log sequence number 0 46459
120917 11:41:12 [Note] Event Scheduler: Loaded 1 event
120917 11:41:12 [Note] Event Scheduler: scheduler thread started with id 1
120917 11:41:12 [Note] /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.1.36-log'  socket: '/tmp/mysql.sock'  port: 3306  MySQL Community Server (GPL)
120917 13:32:03 [Note] /usr/local/mysql/bin/mysqld: Normal shutdown120917 13:32:03 [Note] Event Scheduler: Killing the scheduler thread, thread id 1
120917 13:32:03 [Note] Event Scheduler: Waiting for the scheduler thread to reply
120917 13:32:03 [Note] Event Scheduler: Stopped
120917 13:32:03 [Note] Event Scheduler: Purging the queue. 1 events
120917 13:32:03  InnoDB: Starting shutdown...
120917 13:32:04  InnoDB: Shutdown completed; log sequence number 0 46459
120917 13:32:04 [Warning] Forcing shutdown of 1 plugins
120917 13:32:04 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete120917 13:32:04 mysqld_safe mysqld from pid file /usr/local/mysql/data/localhost.localdomain.pid ended
120917 13:32:04 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
120917 13:32:04 [Warning] The syntax '--log' is deprecated and will be removed in MySQL 7.0. Please use '--general_log'/'--general_log_file' instead.
120917 13:32:04 [Warning] /usr/local/mysql/bin/mysqld: ignoring option '--log-queries-not-using-indexes' due to invalid value '/data/GKJManager/mysql_log/nouseindex.log'
120917 13:32:04 [Note] Plugin 'FEDERATED' is disabled.
120917 13:32:05  InnoDB: Started; log sequence number 0 46459
/usr/local/mysql/bin/mysqld: File '/data/GKJManager/mysql_log/log.log' not found (Errcode: 13)
120917 13:32:05 [ERROR] Could not use /data/GKJManager/mysql_log/log.log for logging (error 13). Turning logging off for the whole duration of the MySQL server process. To turn it on again: fix the cause, shutdown the MySQL server and restart it.
120917 13:32:05 [Note] Event Scheduler: Loaded 1 event
120917 13:32:05 [Note] Event Scheduler: scheduler thread started with id 1
120917 13:32:05 [Note] /usr/local/mysql/bin/mysqld: ready for connections.想知道为什么没有生成其他的日志信息,有知道的麻烦回答我一下,谢谢了!!

解决方案 »

  1.   

    症状是,有的机器突然就不执行这个计划任务了,求解决方法及可能原因。show events 检查一下。另外检查一下变量 event_schedulermysql> show variables like '%sc%';
    +-----------------+-------+
    | Variable_name   | Value |
    +-----------------+-------+
    | event_scheduler | OFF   |
    +-----------------+-------+
    1 row in set (0.00 sec)这个需要是 ON
      

  2.   

    log-queries-not-using-indexes
    这是参数的值应该是逻辑值,也就是 TRUE / FALSE
      

  3.   


    此处是 ON,会不会有什么操作,导致会变成OFF? 或者什么情况下会自动变成OFF
      

  4.   

    原来可以执行,但是 show variables like '%sc%'; 显示OFF后就不执行了,知道什么情况下会变成OFF么?
      

  5.   


    已经确认了 那台不执行的 这个值为OFF了 ,请问会不会有什么操作,导致会变成OFF? 或者什么情况下会自动变成OFF? 谢谢!
      

  6.   

    检查你的 my.cnf 文件中关于这个变量的定义。 如果没有定义,仅仅是通过你自己手工命令设置为ON,则在下次MYSQL生启时仍然会以my.cnf中的值或者默认值为准。
      

  7.   

    你在CNF中
    在[mysqld]的下面加入如下行...
    event_scheduler = 1
      

  8.   

    这位大哥 我在下面加了event_scheduler = 1 然后在Linux系统中输入service mysql restart,然后再一次./mysql 然后输入show variables like '%sc%'; 出来的结果是 disable,我想试着用SET GLOBAL event_scheduler=ON 或者 1 都失败了, 如何才能使其变为ON? 请指教 谢谢!
      

  9.   

    这位大哥 版本信息是: Server version:    5.1.36-log MySQL Community Server (GPL)
      

  10.   

    我原来在cnf文件中加入了一句skip-grant-tables,进入mysql只要./就好了 ,然后前面去掉了,试着使用 ./mysql -p DMLPDB 然后进去之后发现 event 就ON了,不知道是为什么这位大哥,能帮说说为什么会出现这样的情况么?