Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

MySQL ʼþµ÷¶ÈÆ÷(Event Scheduler)


Ò»¡¢¸ÅÊö
¡¡¡¡Ê¼þµ÷¶ÈÆ÷ÊÇÔÚ MySQL 5.1 ÖÐÐÂÔöµÄÁíÒ»¸öÌØÉ«¹¦ÄÜ£¬¿ÉÒÔ×÷Ϊ¶¨Ê±ÈÎÎñµ÷¶ÈÆ÷£¬È¡´ú²¿·ÖÔ­ÏÈÖ»ÄÜÓòÙ×÷ϵͳÈÎÎñµ÷¶ÈÆ÷²ÅÄÜÍê³ÉµÄ¶¨Ê±¹¦>ÄÜ¡£ÀýÈ磬Linux ÖÐµÄ crontabe Ö»Äܾ«È·µ½Ã¿·ÖÖÓÖ´ÐÐÒ»´Î£¬¶ø MySQL µÄʼþµ÷¶ÈÆ÷Ôò¿ÉÒÔʵÏÖÿÃëÖÓÖ´ÐÐÒ»¸öÈÎÎñ£¬ÕâÔÚһЩ¶ÔʵʱÐÔÒª>Çó½Ï¸ßµÄ»·¾³Ï¾ͷdz£ÊµÓÃÁË¡£
¡¡¡¡Ê¼þµ÷¶ÈÆ÷ÊǶ¨Ê±´¥·¢Ö´Ðеģ¬ÔÚÕâ¸ö½Ç¶ÈÉÏÒ²¿ÉÒÔ³Æ×÷ÊÇ"ÁÙʱµÄ´¥·¢Æ÷"¡£´¥·¢Æ÷Ö»ÊÇÕë¶Ôij¸ö±í²úÉúµÄʼþÖ´ÐÐһЩÓï¾ä£¬¶øʼþµ÷¶ÈÆ÷ÔòÊÇÔÚijһ¸ö(¼ä¸ô)ʱ¼äÖ´ÐÐһЩÓï¾ä¡£Ê¼þÊÇÓÉÒ»¸öÌض¨µÄÏß³ÌÀ´¹ÜÀíµÄ£¬Ò²¾ÍÊÇËùνµÄ"ʼþµ÷¶ÈÆ÷"¡£ÆôÓÃʼþµ÷¶ÈÆ÷ºó£¬ÓµÓÐ SUPER ȨÏÞµÄÕË»§Ö´ÐÐ SHOW PROCESSLIST ¾Í¿ÉÒÔ¿´µ½Õâ¸öÏß³ÌÁË¡£Í¨¹ýÉ趨ȫ¾Ö±äÁ¿event_scheduler µÄÖµ¼´¿É¶¯Ì¬µÄ¿ØÖÆʼþµ÷¶ÈÆ÷ÊÇ·ñÆôÓá£
(root:localhost:)test> SET GLOBAL event_scheduler = ON;
(root:localhost:)test> show processlist\G
*************************** 4. row ***************************
     Id: 46147
   User: event_scheduler
   Host: localhost
     db: NULL
Command: Daemon
   Time: 1
  State: Waiting on empty queue
   Info: NULL
¡¡¡¡ÈçÉÏ£¬¸ÃÏ̵߳ÄËùÓÐÕßÊÇ event_scheduler¡£
¡¡¡¡¶þ¡¢Ó¦Óð¸Àý
¡¡¡¡±¾°¸ÀýÊÇÀûÓà event scheduler µÄÌØÐÔ£¬Ã¿ÃëÖÓµ÷ÓÃÒ»´Î´æ´¢¹ý³Ì£¬ÓÃÓÚÅÐ¶Ï SLAVE ÊÇ·ñÕý³£ÔËÐУ¬Èç¹û·¢ÏÖ SLAVE ¹Ø±ÕÁË£¬ºöÂÔ 0 ´Î´íÎó£¬È»ºóÖØÐÂÆô¶¯ SLAVE¡£
¡¡¡¡Ê×ÏÈ´´½¨´æ´¢¹ý³Ì
delimiter //
create procedure `Slave_Monitor`()
begin
SELECT VARIABLE_VALUE INTO @SLAVE_STATUS
from information_schema.GLOBAL_STATUS
WHERE VARIABLE_NAME='SLAVE_RUNNING';
IF ('ON' != @SLAVE_STATUS) THEN
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=0;
 SLAVE START;
END IF;
end; //
delimiter ;
¡¡¡¡ÓÉÓÚ´æ´¢¹ý³ÌÖÐÎÞ·¨µ÷ÓÃÀàËÆ SHOW SLAVE STATUS ÕâÑùµÄÓï¾ä£¬Òò´ËÎÞ·¨µÃµ½È·Çеĸ´ÖÆ´íÎóÐÅÏ¢ºÍ´íÎó´úÂ룬²»ÄܽøÒ»²½µÄ´¦Àí SLAVE Í£Ö¹µÄ¸÷ÖÖÇé¿ö¡£
¡¡¡¡½Ó×Å£¬´´½¨ÈÎÎñ
CREATE EVENT IF NOT EXISTS `Slave_Monitor`
ON SCHEDULE EVERY 5 SECOND
ON COMPLETION PRESERVE
DO
CALL Slave_Monitor();
¡¡¡¡´´½¨ÁËÒ»¸öÈÎÎñ£¬Ã¿ 5ÃëÖÓ Ö´ÐÐÒ»´Î£¬ÈÎÎñ½áÊøºóÒÀ¾É±£Áô¸ÃÈÎÎñ£¬¶ø²»ÊÇɾ³ý¡


Ïà¹ØÎĵµ£º

jbpm4°²×°ÔÚÒÑÓеÄtomcatÓëmysqlÏÂ

1.JBPM4.3ÏÂÔØ(http://sourceforge.net/projects/jbpm)
2.ant°²×°:jBPMÏÂÔØ°üinstallĿ¼ÖÐÓÐÒ»¸öantµÄbuild.xmlÎļþ,ʹÓÃant -pÄã¿ÉÒÔ¿´µ½ËùÓеݲװ
    demo.setup.jboss£º°²×°jboss£¬°Ñjbpm°²×°µ½jbossÖУ¬ Æô¶¯jboss£¬´´½¨jbpmÊý¾Ý¿â±í½á¹¹£¬²¿ÊðʵÀý£¬¼ÓÔØʵÀýÉí·ÝÈÏÖ¤ÐÅÏ¢£¬ °²×°²¢Æô¶¯eclipse
&n ......

mysql Ìí¼ÓÓû§µÄÃüÁî

Ò»¡¢´´½¨Óû§µÄÃüÁî
mysql> create user 'username'@'localhost' identified by 'password';
Query OK, 0 rows affected (0.06 sec)
¶þ¡¢¸øмÓÓû§ÊÚÓèȨÏÞ
mysql> grant all privileges on test.* to 'username'@'localhost';
Query OK, 0 rows affected (0.00 sec)
˵Ã÷£ºÕâÌõÃüÁîÊÚÓè username ¶ÔÊý¾Ý¿â te ......

½â¾öMySQL²»ÔÊÐí´ÓÔ¶³Ì·ÃÎʵķ½·¨

½â¾ö·½·¨£º
1¡£ ¸Ä±í·¨¡£
¿ÉÄÜÊÇÄãµÄÕʺŲ»ÔÊÐí´ÓÔ¶³ÌµÇ½£¬Ö»ÄÜÔÚlocalhost¡£Õâ¸öʱºòÖ»ÒªÔÚlocalhostµÄÄÇ̨µçÄÔ£¬µÇÈëmysqlºó£¬¸ü¸Ä "mysql" Êý¾Ý¿âÀïµÄ "user" ±íÀïµÄ "host" Ï´Ó"localhost"¸Ä³Æ"%"
mysql -u root -p vmware mysql>use mysql;
mysql>update user set host = '%' where user = 'root';
mys ......

¹ØÓÚMySQL±íÉè¼ÆÓ¦¸Ã×¢ÒâµÄÎÊÌâ

¹ØÓÚMySQL±íÉè¼ÆÓ¦¸Ã×¢ÒâµÄÎÊÌâ
ת×Ô http://blog.chinaunix.net/u/29134/showart_1316574.html
1¡¢É÷ÖØÑ¡Ôñ±íÃû¡£
ÓÐÁ½ÖÖÑ¡Ôñ£º
°´ÕÕ¶àÊý¿ª·¢ÓïÑÔµÄÃüÃû¹æÔò¡£±ÈÈ磨myCustomer£©¡£
°´ÕÕ¶àÊý¿ªÔ´Ë¼ÏëÃüÃû¹æÔò¡£±ÈÈ磨my_customer£©¡£
°´ÕÕÔÛÃÇÖйúÈ˵Ä˼Ïë¡£±ÈÈ磨ÎҵĿͻ§£©¡£
µÚÒ»ÖÖÓиöȱµã£¬ºÜÈÝÒ×Íüµô´óдµÄ×Ö ......

Windows Ï Apache Mysql PHP °²×°ºóµÄÅäÖÃ

1 Apache
Ð޸Ġ  documentroot   ¸ùĿ¼
         directory           ·ÃÎʸùĿ¼ȨÏÞ
         directoryindex   Ä¬ÈÏÊ×Ò³ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ