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

¸ã¶¨MySQLÊý¾Ý¿âÖÐÎÄÄ£ºý¼ìË÷ÎÊÌâ

ÔÚ MySQLÏ£¬ÔÚ½øÐÐÖÐÎÄÄ£ºý¼ìË÷ʱ£¬¾­³£»á·µ»ØһЩÓëÖ®²»Ïà¹ØµÄ¼Ç¼£¬Èç²éÕÒ "%a%" ʱ£¬·µ»ØµÄ¿ÉÄÜÓÐÖÐÎÄ×Ö·û£¬È´Ã»ÓÐa×Ö·û´æÔÚ¡£±¾ÈËÒÔÇ°Ò²ÔøÓöµ½¹ýÀàËÆÎÊÌ⣬¾­ÏêϸÔĶÁMySQLµÄManual£¬·¢ÏÖ¿ÉÒÔÓÐÒ»ÖÖ·½·¨ºÜ·½±ãµÄ½â¾ö²¢µÃµ½ÂúÒâµÄ½á¹û¡£
¡¡¡¡Àý×Ó£º
¡¡¡¡Ï£Íûͨ¹ý“±êÌ┶ÔÐÂÎÅ¿â½øÐмìË÷£¬¹Ø¼ü×Ö¿ÉÄÜ°üº¬ÊÇÖÐÓ¢ÎÄ£¬ÈçÏÂSQLÓï¾ä£º
¡¡¡¡QUOTE:
¡¡¡¡select id,title,name from achech_com.news where title like '%a%'
¡¡¡¡·µ»ØµÄ½á¹û£¬Ä³Ð©title×Ö¶ÎÈ·¶¨´øÁË“a”¹Ø¼ü×Ö£¬¶øÓÐЩÔòÖ»ÓÐÖÐÎÄ£¬µ«Ò²ËæÖ®·µ»ØÔÚ¼ìË÷½á¹ûÖС£
¡¡¡¡½â¾ö·½·¨£¬Ê¹Óà BINARY ÊôÐÔ½øÐмìË÷£¬È磺
¡¡¡¡QUOTE:
¡¡¡¡select id,title,name from achech_com.news where binary title like '%a%'
¡¡¡¡·µ»ØµÄ½á¹û½Ï֮ǰÕýÈ·£¬µ«Ó¢ÎÄ×ÖĸÇø·Ö´óСд£¬¹ÊÓÐʱÔÚ¼ìË÷Èç“Achech”¼°“achech”µÄ½á¹ûÊDz»Ò»ÑùµÄ¡£ÖªµÀÁËʹÓà BINARY ÊôÐÔ¿ÉÒÔ½â¾öÇ°ÃæÕâ¸öÎÊÌ⣬ÔÙ¿´¿´ MySQL Ö§³ÖµÄUCASE ¼° CONCAT º¯Êý£¬ÆäÖÐ UCASE Êǽ«Ó¢ÎÄÈ«²¿×ª³É´óд£¬¶øCONCATº¯ÊýµÄ×÷ÓÃÊǶÔ×Ö·û½øÐÐÁ¬½Ó£¬ÒÔÏÂÊÇÎÒÃÇÍêÈ«½â¾öºóµÄSQL Óï¾ä£º
¡¡¡¡QUOTE:
¡¡¡¡select id,title,name from achech_com.news
¡¡¡¡where binary ucase(title) like concat('%',ucase('a'),'%')
¡¡¡¡¼ìË÷µÄ²½ÖèÊÇÏȽ«ÊôÐÔÖ¸¶¨Îª BINARY £¬ÒÔ¾«È·¼ìË÷½á¹û£¬¶ø±» like µÄ titleÄÚÈÝ´æÔÚ´óСд×ÖĸµÄ¿ÉÄÜ£¬¹ÊÏÈʹÓà ucase º¯Êý½«×Ö¶ÎÄÚÈÝÈ«²¿×ª»»³É´óд×Öĸ£¬È»ºóÔÙ½øÐÐ like ²Ù×÷£¬¶ø like µÄ²Ù×÷ʹÓÃÄ£ºý·½·¨£¬Ê¹Óà concatµÄºÃ´¦ÊÇ´«½øÀ´µÄ¿ÉÒÔÊÇÖ±½ÓµÄ¹Ø¼ü×Ö£¬²»ÐèÒª´ø“%”ÍòÓ÷û£¬½«“'a'”Ö±½Ó»»³ÉÄãµÄ±äÁ¿£¬ÔÚÈκÎÓïÑÔ϶¼ÍòÊÂÎÞÓÇÁË¡£ µ±È»ÄãÒ²¿ÉÒÔÕâôд£º
¡¡¡¡QUOTE:
¡¡¡¡select id,title,name from achech_com.news where binary ucase(title) like ucase('%a%')
¡¡¡¡¼ìË÷µÄ½á¹û»¹ËãÂúÒâ°É£¬²»¹ýËٶȿÉÄÜ»áÒò´Ë¶øÂýNºÁÃë¡£


Ïà¹ØÎĵµ£º

[Ô­´´] MySQL Proxy ѧϰ±Ê¼Ç


[Ô­´´] MySQL Proxy ѧϰ±Ê¼Ç
×÷Õߣºheiyeluren
ʱ¼ä£º2008-1-28
²©¿Í£ºhttp://blog.csdn.net/heiyeshuwu
¡¾ ²âÊÔƽ̨ ¡¿
·þÎñÆ÷¶Ë£º
OS£ºFreeBSD 6.2
Lua£º 5.1.1
MySQL Server£º4.1.22-log
MySQL Proxy£º 0.6.0
¿Í»§¶Ë£º
OS£ºWindows XP Pro SP2
PHP£º PHP 5.2.4 (cli)
MySQL Client£º Ver 14.13 Distrib ......

mysql ÈÕÆÚĬÈÏϵͳʱ¼ä mysql ĬÈÏÖµ²»Ö§³Öº¯Êý

ÓÉÓÚMySQLÄ¿Ç°×ֶεÄĬÈÏÖµ²»Ö§³Öº¯Êý£¬ËùÒÔÒÔ
create_time datetime default now()
µÄÐÎʽÉèÖÃĬÈÏÖµÊDz»¿ÉÄܵġ£
´úÌæµÄ·½°¸ÊÇʹÓÃTIMESTAMPÀàÐÍ´úÌæDATETIMEÀàÐÍ¡£
TIMESTAMPÁÐÀàÐÍ×Ô¶¯µØÓõ±Ç°µÄÈÕÆÚºÍʱ¼ä±ê¼ÇINSERT»òUPDATEµÄ²Ù×÷¡£
Èç¹ûÓжà¸öTIMESTAMPÁУ¬Ö»ÓеÚÒ»¸ö×Ô¶¯¸üС£
×Ô¶¯¸üеÚÒ»¸öTIMESTAMPÁÐÔÚÏ ......

mysqlÔ¶³Ì·ÃÎʵÄÉèÖÃ

µÇ½ÒÔºóÔËÐÐÒÔÏÂÃüÁ¸øÓèÔ¶³Ì·ÃÎÊ¿Í»§¶ËȨÏÞ..
grant all on *.* to 'remote'@'172.16.21.39' identified by 'password';
remote±íʾÓû§Ãû.
'172.16.21.39' Ô¶³ÌipµØÖ·
password±íʾԶ³ÌµÇ½ÃÜÂë.
ĬÈÏ×´¿öÏ£¬³öÓÚ°²È«¿¼ÂÇ£¬mysqlÊý¾Ý¿âÆÁ±ÎÁËÔ¶³Ì·ÃÎʹ¦ÄÜ¡£ È»¶øÔÚÐí¶à×´¿öÏ£¬ÄãÐèÒªÔÚ¼Ò
»òÕß´Óweb³ÌÐòÈ¥·ÃÎÊ ......

hibernateÔÚMYSQLÖеÄʹÓÃ

Hibernate ÅäÖÃͨ¹ýc3p0Á¬½ÓMYSQL
** ÐèÒªµÄ°ü: c3p0_versionxx.jar
** hibernate.cfg.xml
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
          "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
  &n ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ