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

ÉîÈëÑо¿Mysql×Ö·û¼¯ÉèÖÃÒÔ¼°ÅÅÐò·½Ê½

¸ù¾ÝChaos WangµÄPPTÕûÀí¶ø³É£¬ ÔÚ´ËÔٴθÐлChaos WangµÄ´Ë´ÎTechTalk
»ù±¾¸ÅÄî
• ×Ö·û(Character)ÊÇÖ¸ÈËÀàÓïÑÔÖÐ×îСµÄ±íÒå·ûºÅ¡£ÀýÈç'A'¡¢'B'µÈ£»
• ¸ø¶¨Ò»ÏµÁÐ×Ö·û£¬¶Ôÿ¸ö×Ö·û¸³ÓèÒ»¸öÊýÖµ£¬ÓÃÊýÖµÀ´´ú±í¶ÔÓ¦µÄ×Ö·û£¬ÕâÒ»ÊýÖµ¾ÍÊÇ×Ö·ûµÄ±àÂë(Encoding)¡£ÀýÈ磬ÎÒÃǸø×Ö·û'A'¸³ÓèÊýÖµ0£¬¸ø×Ö·û'B'¸³ÓèÊýÖµ1£¬Ôò0¾ÍÊÇ×Ö·û'A'µÄ±àÂ룻
• ¸ø¶¨Ò»ÏµÁÐ×Ö·û²¢¸³Óè¶ÔÓ¦µÄ±àÂëºó£¬ËùÓÐÕâЩ×Ö·ûºÍ±àÂë¶Ô×é³ÉµÄ¼¯ºÏ¾ÍÊÇ×Ö·û¼¯(Character Set)¡£ÀýÈ磬¸ø¶¨×Ö·ûÁбíΪ{'A','B'}ʱ£¬{'A'=>0, ‘B'=>1}¾ÍÊÇÒ»¸ö×Ö·û¼¯£»
• ×Ö·ûÐò(Collation)ÊÇÖ¸ÔÚͬһ×Ö·û¼¯ÄÚ×Ö·ûÖ®¼äµÄ±È½Ï¹æÔò£»
• È·¶¨×Ö·ûÐòºó£¬²ÅÄÜÔÚÒ»¸ö×Ö·û¼¯É϶¨ÒåʲôÊǵȼ۵Ä×Ö·û£¬ÒÔ¼°×Ö·ûÖ®¼äµÄ´óС¹Øϵ£»
• ÿ¸ö×Ö·ûÐòΨһ¶ÔÓ¦Ò»ÖÖ×Ö·û¼¯£¬µ«Ò»¸ö×Ö·û¼¯¿ÉÒÔ¶ÔÓ¦¶àÖÖ×Ö·ûÐò£¬ÆäÖÐÓÐÒ»¸öÊÇĬÈÏ×Ö·ûÐò(Default Collation)£»
• MySQLÖеÄ×Ö·ûÐòÃû³Æ×ñ´ÓÃüÃû¹ßÀý£ºÒÔ×Ö·ûÐò¶ÔÓ¦µÄ×Ö·û¼¯Ãû³Æ¿ªÍ·£»ÒÔ_ci(±íʾ´óСд²»Ãô¸Ð)¡¢_cs(±íʾ´óСдÃô¸Ð)»ò_bin(±íʾ°´±àÂëÖµ±È½Ï)½áβ¡£ÀýÈ磺ÔÚ×Ö·ûÐò"utf8_general_ci"Ï£¬×Ö·û"a"ºÍ"A"Êǵȼ۵ģ»
MySQL×Ö·û¼¯ÉèÖÕ ϵͳ±äÁ¿£º
- character_set_server£ºÄ¬ÈϵÄÄÚ²¿²Ù×÷×Ö·û¼¯
- character_set_client£º¿Í»§¶ËÀ´Ô´Êý¾ÝʹÓõÄ×Ö·û¼¯
- character_set_connection£ºÁ¬½Ó²ã×Ö·û¼¯
- character_set_results£º²éѯ½á¹û×Ö·û¼¯
- character_set_database£ºµ±Ç°Ñ¡ÖÐÊý¾Ý¿âµÄĬÈÏ×Ö·û¼¯
- character_set_system£ºÏµÍ³ÔªÊý¾Ý(×Ö¶ÎÃûµÈ)×Ö·û¼¯
- »¹ÓÐÒÔcollation_¿ªÍ·µÄͬÉÏÃæ¶ÔÓ¦µÄ±äÁ¿£¬ÓÃÀ´ÃèÊö×Ö·ûÐò¡£
• ÓÃintroducerÖ¸¶¨Îı¾×Ö·û´®µÄ×Ö·û¼¯£º
- ¸ñʽΪ£º[_charset] 'string' [COLLATE collation]
- ÀýÈ磺
• SELECT _latin1 'string';
• SELECT _utf8 ‘ÄãºÃ' COLLATE utf8_general_ci;
- ÓÉintroducerÐÞÊεÄÎı¾×Ö·û´®ÔÚÇëÇó¹ý³ÌÖв»¾­¹ý¶àÓàµÄתÂ룬ֱ½Óת»»ÎªÄÚ²¿×Ö·û¼¯´¦Àí¡£
MySQLÖеÄ×Ö·û¼¯×ª»»¹ý³Ì1. MySQL ServerÊÕµ½ÇëÇóʱ½«ÇëÇóÊý¾Ý´Ócharacter_set_clientת»»Îªcharacter_set_connection£»
2. ½øÐÐÄÚ²¿²Ù×÷Ç°½«ÇëÇóÊý¾Ý´Ócharacter_set_connectionת»»ÎªÄÚ²¿²Ù×÷×Ö·û¼¯£¬ÆäÈ·¶¨·½·¨ÈçÏ£º
• ʹÓÃÿ¸öÊý¾Ý×ֶεÄCHARACTER SETÉ趨ֵ£»
• ÈôÉÏÊöÖµ²»´æÔÚ£¬ÔòʹÓöÔÓ¦Êý¾Ý±íµÄDEFAULT CHARACTER SETÉ趨ֵ(MySQLÀ©Õ¹£¬·ÇSQL±ê×¼)£»
• ÈôÉÏÊ


Ïà¹ØÎĵµ£º

MYSQLÍâ¼ü(Foreign Key)µÄʹÓ㨶þ£©

×÷ÕߣºDirk (dirk.ye AT gmail.com)
Url£ºhttp://dirk.pdx.cn
ÈÕÆÚ£º2004/12/08
Ê×ÏÈ£¬Ä¿Ç°ÔÚ²úÆ·»·¾³¿ÉÓõÄMySQL°æ±¾£¨Ö¸4.0.xºÍ4.1.x£©ÖУ¬Ö»ÓÐInnoDBÒýÇæ²ÅÔÊÐíʹÓÃÍâ¼ü£¬ËùÒÔ£¬ÎÒÃǵÄÊý¾Ý±í±ØÐëʹÓÃ
InnoDBÒýÇæ¡£
ÏÂÃ棬ÎÒÃÇÏÈ´´½¨ÒÔϲâÊÔÓÃÊý¾Ý¿â
񡜧
CREATE TABLE `roottb` (
`id` INT(11) UNSIGNED AU ......

Mysql²éѯ·ÖÒ³

˵Ã÷£ºÕâÊÇÒ»¸öʵÀý£¬ÆäÖÐÓÐЩ¶«Î÷ÊÇ¿ÉÒÔ³éÈ¡³öÀ´µÄ£¬×÷Ϊһ¸ö¹«¹²µÄ·½·¨£¬¿ÉÊÇʵÏÖ¸´ÓÃ
public class TestService {
public static TestService test=null;
public static TestService getTestService(){
if(test==null){
test=new TestService();
}
return test;
}
public List getTest(int pageNo ......

MyEclipse6.6 Á¬½ÓMySQLµÄÊý¾Ý¿âÅäÖÃ

1¡¢´ò¿ªMyEclipse6.6
2¡¢Ñ¡Ôñ²Ëµ¥£ºWindow/Open Perspective/MyEclipse Database Explorer£¬µã»÷OK£¬ÔÚ×ó±ß´ò¿ªDB Brower´°¿Ú¡£
3¡¢ÔÚDB Brower´°¿ÚÄÚÈÎÒâ¿Õ°×´¦»÷ÓÒ¼ü£¬Ñ¡ÔñNewÃüÁµ¯³öDatabase Driver´°¿Ú
4¡¢±¾´°¿Ú¸÷Ïî˵Ã÷£º
   Driver template: MySQL Connector/J   Ñ¡ÔñÇý¶¯Ä£°å
 & ......

Struts+Hibernate+MySqlÖÐÎÄÂÒÂë½â¾ö·½°¸

1¡¢ÐÞ¸ÄMySqlÊý¾Ý¿âµÄmy.iniÅäÖÃÎļþ¡¢
# CLIENT SECTION
# ----------------------------------------------------------------------
#
# The following options will be read by MySQL client applications.
# Note that only client applications shipped by MySQL are guaranteed
# to read this section. If yo ......

MySQL collation·½·¨

ÎÊÌâÊÇÕâÑùµÄ£º
Ò»ÕÅtestµÄ±í£¬×Ö·û¼¯²ÉÓõÄlatin1¡£
select to_id from test where to_id='cnÏó_Íõ';
+---------------+
| to_id |
+---------------+
| cnÌÕ_ÌÕ |
| cnÏó_Íõ |
+---------------+
2 rows in set (0.00 sec)
È¡cnÏó_ÍõµÄÊý¾Ý,¾ÓÈ»°ÑcnÌÕ_ÌÕµÄÊý¾ÝҲȡ»ØÀ´ÁË¡£
ÕâÏÔÈ»ÊDz»ÔÊÐíµÄ¡£
......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ