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

MysqlÈÎÎñµ÷¶È£¨Event£©

<!-- [if gte mso 10]>
MySQL5.1.x
°æ±¾ÖÐÒýÈëÁËÒ»ÏîÐÂÌØÐÔ
EVENT
£¬¹ËÃû˼Òå¾ÍÊÇʼþ¡¢¶¨Ê±ÈÎÎñ»úÖÆ£¬ÔÚÖ¸¶¨µÄʱ¼äµ¥ÔªÄÚÖ´ÐÐÌض¨µÄÈÎÎñ£¬Òò´Ë½ñºóһЩ¶ÔÊý¾Ý¶¨Ê±ÐÔ²Ù×÷²»ÔÙÒÀÀµÍⲿ³ÌÐò£¬¶øÖ±½ÓʹÓÃÊý¾Ý¿â±¾ÉíÌṩµÄ¹¦ÄÜ¡£´Ë¹¦ÄÜÊǶÔ
Oracle
µÄ
Job/Schedule
µÄÄ£·Â£¬
5.1.X
°æ±¾ÒÔÉϲÅÖ§³Ö¡£
        
´´½¨
EVENT
Óï·¨ÈçÏ£º
CREATE
[DEFINER = { user | CURRENT_USER }]
EVENT
[IF NOT EXISTS]
event_name
ON SCHEDULE schedule
[ON COMPLETION [NOT] PRESERVE]
[ENABLE | DISABLE | DISABLE ON SLAVE]
[COMMENT ''comment'']
DO sql_statement;
 
schedule:
AT timestamp [+ INTERVAL interval]
| EVERY interval
[STARTS timestamp [+ INTERVAL interval]]
[ENDS timestamp [+ INTERVAL interval]]
 
interval:
quantity {YEAR | QUARTER | MONTH | DAY | HOUR | MINUTE |
WEEK | SECOND | YEAR_MONTH | DAY_HOUR | DAY_MINUTE |
DAY_SECOND | HOUR_MINUTE | HOUR_SECOND | MINUTE_SECOND}
 
ÀýÈç´´½¨Ò»¸öÿ
30
ÃëÇå¿Õ
tableA
Êý¾ÝµÄÈÎÎñ
CREATE EVENT E_DELETE_ASO_TOKEN ON SCHEDULE
EVERY 30 SECOND DO DELETE from tableA ;
ĬÈÏ
EVENT
Ö§³ÖÊÇûÓÐÆô¶¯µÄ£¬¿ÉÒÔͨ¹ýÏÂÃæµÄÃüÁîÀ´²é¿´×´Ì¬£º
Select @@event_scheduler;
Èç¹û·µ»Ø
OFF
£¬ÔòÐèÒªÖ´ÐÐÏÂÃæµÄÃüÁîÆô¶¯£º
SET GLOBAL event_scheduler = ON;
ºÃÁË£¬ÉÏÃæËäÈ»Æô¶¯ÁË
EVENT
£¬µ«ÊÇÿ´ÎÖØÆô
mysql
Ö®ºó
EVENT
²¢Ã»ÓÐ×Ô¶¯Æô¶¯£¬ÄÇôÈçºÎÈÃËü×Ô¶¯Æô¶¯ÄØ£¿
·½·¨Ò»£ºÕÒµ½µ±Ç°Ê¹ÓõÄ
.cnf
Îļþ£¬ÔÚ
[mysqld]
µÄÏÂÃæ¼ÓÈëÈçÏÂÐÐ
event_scheduler=1
·½·¨¶þ£ºÆô¶¯
mysql
µÄʱºòÔö¼Ó
--event_scheduler=1
mysql start --event_scheduler=1
ʼþÏêϸÓï·¨ÊÂÀý
(EVENT)
 
1>
´´½¨Ê¼þ
(CREATE
EVENT)
ÏÈÀ´¿´Ò»ÏÂËüµÄÓï·¨£º
CREATE EVENT [IF NOT EXISTS] event_name
   
ON SCHEDULE schedule
  
 
[ON COMPLETION [NOT] PRESERVE]
   
[ENABLE | DISABLE]
   
[COMMENT ''comment'']
   
DO sql_statement;
 
schedule:
   
AT TIMESTAMP [+ INTERVAL INTERVAL]
 
|
EVERY INTERVAL [STARTS TIMESTAMP] [END


Ïà¹ØÎĵµ£º

MySQLÃüÁî


³£ÓÃmysqlÃüÁîÐÐÃüÁî
¡¡¡¡1 .mysqlµÄÆô¶¯ÓëÍ£Ö¹
¡¡¡¡Æô¶¯MYSQL·þÎñ net start mysql
¡¡¡¡Í£Ö¹MYSQL·þÎñ net stop mysql
¡¡¡¡2 . netstat –na | findstr 3306 ²é¿´±»¼àÌýµÄ¶Ë¿Ú , findstrÓÃÓÚ²éÕÒºóÃæµÄ¶Ë¿ÚÊÇ·ñ´æÔÚ
¡¡¡¡3 . ÔÚÃüÁîÐÐÖеǽMYSQL¿ØÖÆ̨ , ¼´Ê¹Óà MYSQL COMMEND LINE TOOL
¡¡¡¡ Óï·¨¸ñʽ ......

תmysql×Ö·û¼¯¼°±àÂëת»»Ñ§Ï°Æª


mysql
·þÎñÆ÷ÖÐÓÐÁù¸ö¹Ø¼üλÖÃʹÓÃÁË×Ö·û¼¯µÄ¸ÅÄî,

ËûÃÇÊÇ£º

client
¡¢connection
¡¢database
¡¢results
¡¢server,

 
a
¡¢ÆäÖÐclient
ÊÇ¿Í»§¶ËʹÓõÄ×Ö·û¼¯£¬Ï൱ÓÚÍøÒ³ÖеÄ×Ö·û¼¯ÉèÖÃÈçÏÂ

<
meta http-equiv
=
"Content-Type"
content
=
"text/html;charset=utf ......

MySql±Ê¼Ç02

Ò»¡¢Á¬½ÓMYSQL
¡¡¡¡¸ñʽ£º mysql -hÖ÷»úµØÖ· -uÓû§Ãû £­pÓû§ÃÜÂë
¡¡¡¡1¡¢Àý1£ºÁ¬½Óµ½±¾»úÉϵÄMYSQL¡£
¡¡¡¡Ê×ÏÈÔÚ´ò¿ªDOS´°¿Ú£¬È»ºó½øÈëĿ¼ mysqlbin£¬ÔÙ¼üÈëÃüÁîmysql -uroot -p£¬»Ø³µºóÌáʾÄãÊäÃÜÂ룬Èç¹û¸Õ°²×°ºÃMYSQL£¬³¬¼¶Óû§rootÊÇûÓÐÃÜÂëµÄ£¬¹ÊÖ±½Ó»Ø³µ¼´¿É½øÈëµ½MYSQLÖÐÁË£¬MYSQLµÄÌáʾ·ûÊÇ£ºmysql>
¡¡¡ ......

Ubuntu Öа²×°MySQL GUI Tools

±àÒëÇ°ÐèÒª°²×°µÄ¿â£º
g++
libmysqlclient15-dev
libglade2-dev
libglib2.0-dev
libgtkmm-2.4-dev
libpcre3-dev
libxml2-dev
È»ºóÖ´ÐÐ
cd mysql-gui-common
./configure
make
sudo make install
cd ../mysql-administrator
./configure
make
sudo make install
°²×°MySQL Administrator
°²×°Íê³Éºómysql- ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ