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

[MySQL 5.1 ÌåÑé]MySQL ʼþµ÷¶ÈÆ÷(Event Scheduler)

http://hi.baidu.com/tianxia_1209/blog/item/a2613822fec7e7f6d6cae267.html
MYSQLµÄʼþÊÇ5.1ÐÂÔö¼ÓµÄ£¬Èç¹ûÏëÌåÑ飬½¨ÒéÉý¼¶°æ±¾¡£
ÖÁÓÚÓï·¨ÎҾͲ»¶à˵ÁË£¬ÊÖ²áÉϽ²µÄºÜÏêϸ£¬ÎÒÀ´ËµËµ¼¸¸öÒªµãÒÔ¼°Ò»Ð©ÊµÀý¡£
×¢ÒâÊÂÏ
1¡¢EVENTȨÏÞÊÇÕë¶ÔģʽµÄ£¨ÔÚMYSQLÖÐÒ²¾ÍÊÇ¿âµÄ¼¶±ð£©£¬²»ÄܶԵ¥¶À±íÀ´¸³ÓèȨÏÞ¡£
2¡¢±ØÐëÔÚÈ«¾Ö¿ªÆô¡£
3¡¢ÐÔÄÜÉϵÄËðʧһ¶¨µÃ¿¼Âǵ½¡£
mysql> show variables like '%event%';
+-----------------+-------+
| Variable_name   | Value |
+-----------------+-------+
| event_scheduler | OFF   |
+-----------------+-------+
1 row in set (0.00 sec)
mysql> set global event_scheduler = on;
Query OK, 0 rows affected (0.00 sec)
mysql> use event;
Database changed
Àý×Ó£º
ÎÒÃÇÀ´´´½¨Ò»¸ö¼òµ¥µÄÎÄÕÂ±í£º
mysql> create table article (id serial,title varchar(64) not null, author_name varchar(64),content mediumtext not null, create_time datetime not null,update_time datetime not null);
Query OK, 0 rows affected (0.01 sec)
ÒÔ¼°Í³¼Æ±í£º
mysql> create table report (id int not null auto_increment primary key, r_date date not null,aid int not null,total int not null);
Query OK, 0 rows affected (0.01 sec)
mysql> ²åÈë²âÊÔÊý¾Ý¡£¡£¡£
ÎÒÃÇÀ´½¨Á¢Ò»¸ö´æ´¢¹ý³Ì¡£
mysql> delimiter ||
mysql> create procedure sp_report()
     -> begin
     -> insert into report(r_date,aid,total) select date(update_time) as r_date, id,count(1) from article group by date(create_time) order by r_date asc;
     -> end||
Query OK, 0 rows affected (0.00 sec)
mysql> delimiter ;
´´½¨EVENT;
ÔÚÒ»·ÖÖÓºóÖ´ÐÐÕâ¸ö´æ´¢¹ý³Ì¡£
mysql> create event report_dawn on schedule at date_add(now(),interval 1 minute) on completion preserve do call sp_report();
Query OK, 0 rows affected (0.00 sec)
mysql> show processlist;
| 7 | event_scheduler | localhost         | NULL   | Daemon |     5 | Waiting for next activation | NULL 


Ïà¹ØÎĵµ£º

×ªÔØ mysqlÔõôȡ³ö×îÐÂÔö¼ÓµÄÊý¾Ý

´ÓºËÌÒ²©¿Í
×ªÔØ£¬
ÓÑÇéÎÊ´ð2-mysqlÔõôȡ³ö×îÐÂÔö¼ÓµÄÊý¾Ý
ÔÚhttp://zhidao.baidu.com/question/131093225.html
ÓÐÈËÎÊ“mysqlÔõôȡ³ö×îÐÂÔö¼ÓµÄÊý¾Ý”£¬
ÆäʵÕýÈ·µÄ·½Ê½Êǽ«×ֶζ¨Òå³Éint primary key
auto_increment£¬È»ºóÓÃlast_insert_id()È¡³öÀ´£¬ÒòΪÕâÊÇÃæÏòÁ¬½ÓµÄ£¬Ḭ̈߳²È«µÄ£¬Èç¹ûÈ¡max(id)ÕâÑ ......

OracleDB,MySQL×Ö·û´®²Ù×÷º¯ÊýINSTR£¬SUBSTRING_INDEX

ÌâÄ¿£º¸ø¶¨Ò»¸ö·Ö¸î·û£¬ÔõÑùµÃµ½¸ø¶¨×Ö·û´®×îºóÒ»¸ö·Ö¸î·ûºóµÄ×Ö·û´®¡£ È磺‘fsb-ibees-zxj-fsbk’ ÔõÑùµÃµ½fsbk, ÒªÇó£ºjavaʵÏÖ£¬sqlʵÏÖ£¿sql¿ÉÒÔÊÇoracle£¬mysqlµÈʵÏÖ¡£
 1.OracleʵÏÖ
SET SERVEROUTPUT ON;
DECLARE
str VARCHAR2(266):='123-890-ibees-zxj';--±»½âÎöµÄ×Ö·û´®
splitStr VARCH ......

½â¾öÔ¶³ÌÁ¬½Ómysql´íÎó1130´úÂëµÄ·½·¨

http://hi.baidu.com/qk618/blog/item/f61e5830f2125d93a9018e0c.html
½â¾öÔ¶³ÌÁ¬½Ómysql´íÎó1130´úÂëµÄ·½·¨
½ñÌìÔÚÓÃÔ¶³ÌÁ¬½ÓMysql·þÎñÆ÷µÄÊý¾Ý¿â£¬²»¹ÜÔõôŪ¶¼ÊÇÁ¬½Ó²»µ½£¬´íÎó´úÂëÊÇ1130£¬ERROR 1130: Host 192.168.2.159 is not allowed to connect to this MySQL server
²ÂÏëÊÇÎÞ·¨¸øÔ¶³ÌÁ¬½ÓµÄÓû§È¨ÏÞÎÊÌâ¡£½á¹ ......

MySQLʵÏÖÊ÷µÄ±éÀú

¾­³£ÔÚÒ»¸ö±íÖÐÓи¸×Ó¹ØÏµµÄÁ½¸ö×ֶΣ¬±ÈÈçempnoÓëmanager£¬ÕâÖֽṹÖÐÐèÒªÓõ½Ê÷µÄ±éÀú¡£ÔÚOracle ÖпÉÒÔʹÓÃconnect by¼òµ¥½â¾öÎÊÌ⣬²Î¼ûhttp://blog.csdn.net/wzy0623/archive/2007/06/18/1656345.aspx£¬µ«MySQL 5.1Öл¹²»Ö§³Ö£¨¾Ý˵ÒÑÄÉÈëto doÖУ©£¬Òª×Ô¼ºÐ´¹ý³Ì»òº¯ÊýÀ´ÊµÏÖ¡£
Ò»¡¢½¨Á¢²âÊÔ±íºÍÊý¾Ý£º
DROP TABLE ......

mysql substring

µÃ°²Ææ×¨Âô£¨Ô˶¯ÐÝÏÐЬ£¬°åЬ£©ÌÔ±¦Ð¡µê£ºwww.bxbshoes.com
substring£º
Óï·¨
SUBSTRING ( expression , start , length )   
²ÎÊý
expression     
ÊÇ×Ö·û´®¡¢¶þ½øÖÆ×Ö·û´®¡¢text¡¢image¡¢Áлò°üº¬Áеıí´ïʽ¡£²»ÒªÊ¹Óðüº¬¾ÛºÏº¯ÊýµÄ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ