ÀûÓÃmysqlº¯Êý¸üÐÂmemcached
Memcached Functions for MYSQL¹Ù·½Ö÷Ò³£º
https://launchpad.net/memcached-udfs
Á½Æª»ù±¾ÎÄÕ£º
http://www.libing.name/2009/02/06/mysql-map-data-to-memcached.html
http://www.libing.name/2008/02/26/mysql-map-memcached.html
°²×°ºÍÑéÖ¤µÄSQLÓï¾ä£º
http://hg.tangent.org/memcached_functions_mysql/file/724eeccc55bc/README
°²×°£º
1.°²×°mysql
2.°²×°memcached
3.Æô¶¯mysql,memcached
/usr/local/bin/memcached -p 22222 -m 64m -u root -d
4.°²×°Memcached Functions for MYSQL
tar xzvf memcached_functions_mysql-0.2.tar.gz
cd memcached_functions_mysql-0.2
./configure –with-mysql=MYSQL_DIR/bin/mysql_config –libdir=MYSQL_DIR/lib/mysql/
make
make install
5.½«UDFs¼ÓÔØµ½MySQLÖУ¨UDF=User Defined Function£©
memc_servers_set()
mysql> create function memc_servers_set returns int soname "libmemcached_functions_mysql.so";
memc_set()
mysql> create function memc_set returns int soname "libmemcached_functions_mysql.so";
memc_get()
mysql> create function memc_get returns string soname "libmemcached_functions_mysql.so";
memc_delete()
mysql> create function memc_delete returns string soname "libmemcached_functions_mysql.so";
......
ÆäËûº¯ÊýµÄ¼ÓÔØÊ¡ÂÔ
6.ÑéÖ¤
select memc_servers_set('127.0.0.1:22222');
select memc_set('key','value');
select memc_get('key');
select memc_delete('key');
7.´¥·¢Æ÷¸üÐÂmemcached
£¨1£©´´½¨±í
create table memc_test(
key varchar(100),
value varchar(100)
);
£¨2£©´´½¨´¥·¢Æ÷
delimiter ;;
create trigger memc_add after insert on memc_test for each row begin
select memc_set(NEW.key,NEW.value);
end;;
delimiter ;
delimiter ;;
create trigger memc_update after update on memc_test for each row begin
select memc_set(NEW.key,NEW.value);
Ïà¹ØÎĵµ£º
µÃ°²Ææ×¨Âô£¨Ô˶¯ÐÝÏÐЬ£¬°åЬ£©ÌÔ±¦Ð¡µê£ºwww.bxbshoes.com
substring£º
Óï·¨
SUBSTRING ( expression , start , length )
²ÎÊý
expression
ÊÇ×Ö·û´®¡¢¶þ½øÖÆ×Ö·û´®¡¢text¡¢image¡¢Áлò°üº¬Áеıí´ïʽ¡£²»ÒªÊ¹Óðüº¬¾ÛºÏº¯ÊýµÄ ......
×î½üÔÚÑо¿CMS£¬ÔÚÊý¾Ýת»»µÄʱºòÐèÒªÓõ½mysqlµÄreplaceº¯Êý£¬ÕâÀï¼òµ¥½éÉÜһϣ¡
±ÈÈçÄãÒª½« ±í tb1ÀïÃæµÄ f1×ֶεÄabcÌæ»»Îªdef
UPDATE tb1 SET f1=REPLACE(f1, 'abc', 'def');
REPLACE(str,from_str,to_str)
ÔÚ×Ö·û´® str ÖÐËùÓгöÏÖµÄ×Ö·û´® from_str&nbs ......
Õ⼸Ìì×öÒ»¸ö²éѯ£¬ÐèÒªÔÚÒ»¸öÖ¸¶¨µÄ½á¹û¼¯ÖнøÐвéѯ£¬ÀýÈ磺
select * from table_name where doc_id IN ('1dba', 'c20a', '907b')
ÆäÖÐIN×Ó¾äÖеÄdoc_idÁбíÊÇͨ¹ýµ÷ÓÃÒ»¸öÍⲿ½Ó¿Ú»ñµÃÒ»×édoc_id³£Á¿ÁÐ±í£¬È»ºóÔÚ±¾µØ¿âÖÐËÑË÷·ûºÏÕâ¸öÁбíµÄÊý¾Ý
¼Ç¼¡£ºóÀ´·¢ÏÖmysql·µ»ØµÄ½á¹û¼¯µÄÅÅÐòÊǰ´ÕÕÈë¿â˳Ðò¸ø³öµÄ£¬µ«ÊÇÎÒ ......
ÖÐÎÄÏÔʾÎÊÌâÒ»Ö±ÊÇÀ§ÈÅÎÒÃǵÄÒ»¸öÄÑÌ⣬²»ÐÅÄãÉÏgoogleËÑË÷һϣ¬ÕâÀàµÄÎÊÌâºÍ½â´ð¿ÉÒÔ˵ÊÇÆÌÌì¸ÇµØ£¬ºÃ¶àÍøÕ¾ÉõÖÁ½«ÆäÌá³öÀ´×÷ΪרÌâÀ´ÌÖÂÛ£¬¹ÜÖпú±ª£¬¿É¼ûÒ»°ß¡£
¿ªÊ¼Ò²ÔøÎªÕâ¸öÎÊÌâÍ·ÌÛ£¬ÉÏÍø²éÔÄ´óÁ¿µÄ×ÊÁϺͽâ¾ö·½·¨£¬ÖÕÓÚÕÒµ½ÁËÒ»Öּȼòµ¥ÓÖºÃÓõİ취£¬ÒÔJSP+MYSQL´æ´¢ÎªÀý£¬¼òµ¥½éÉÜÒ ......
ÏàÐźܶàµÄÅóÓѶÔʹÓÃiBatis¹ÜÀíÊý¾Ý¿âºÜ²»Ï°¹ß£¬ÒòΪÎÒÃÇÒªÊÖд´úÂë£¬ÌØ±ðÊÇdynamic
query²¿·Ö¸üÊDz»ÖªÈçºÎǶÌ×£¬¶øÕâЩÊÇ¿ÉÒÔÓù¤¾ßµÄ£¡ÏÂÃæ½éÉÜÒ»ÖÖ×î³£Óõ졲»·Ï»°ÁË£¬Ö±½ÓÉÏÅäÖùý³Ì£¡
1¡¢»ñµÃ http://ibatis.apache.org/abator.html
Eclipse¿ÉÒÔ×Ô¶¯µÄ½øÐÐUpdate»ñÈ¡´ËPlugin ......