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

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»ÔÊÐíµÄ¡£
²é¿´ËüÃǵıàÂ룺
(root@im_offlog1a)[test]> select hex('cnÌÕ_ÌÕ');
+----------------+
| hex('cnÌÕ_ÌÕ') |
+----------------+
| 636ECCD55FCCD5 |
+----------------+
1 row in set (0.00 sec)
(root@im_offlog1a)[test]> select hex('cnÏó_Íõ');
+----------------+
| hex('cnÏó_Íõ') |
+----------------+
| 636ECFF35FCDF5 |
+----------------+
1 row in set (0.00 sec)
±àÂëµÄÈ·ÊDz»Ò»ÑùµÄ£¬µ«ÊÇΪʲômysql»áÈÏΪÕâÁ½Ìõ¼Ç¼ÊÇÒ»ÑùµÄÄØ£¿
Ò»¿ªÊ¼ÎÒÃǾͰÑÎÊÌⶨλÓÚcollationÒýÆðµÄÎÊÌâ¡£
show variables²é¿´
| collation_connection | latin1_swedish_ci
| collation_database | latin1_swedish_ci
| collation_server | latin1_swedish_ci
ÊÖ¹¤°ÑÕâЩ²ÎÊýÐÞ¸ÄΪlatin1_bin£¬½á¹û¾ÓȻһÑù¡£ÕâϸоõÕæÊÇÆæ¹ÖÁË¡£
ÕâÀïÏȽâÊÍÒ»ÏÂmysql collationµÄÃüÃû¹æÔò£º
ËüÃÇÒÔÆäÏà¹ØµÄ×Ö·û¼¯Ãû¿ªÊ¼£¬Í¨³£°üÀ¨Ò»¸öÓïÑÔÃû£¬²¢ÇÒÒÔ_ci£¨´óСд²»Ãô¸Ð£©¡¢_cs£¨´óСдÃô¸Ð£©»ò_bin£¨¶þÔª£©½áÊø
±ÈÈçlatin1×Ö·û¼¯ÓÐÒÔϼ¸ÖÖУÕý¹æÔò£º
У¶Ô¹æÔò º¬Òå
latin1_german1_ci µÂ¹úDIN-1
latin1_swedish_ci Èðµä/·ÒÀ¼
latin1_danish_ci µ¤Âó/ŲÍþ
latin1_german2_ci µÂ¹ú DIN-2
latin1_bin ·ûºÏlatin1±àÂëµÄ¶þ½øÖÆ
latin1_general_ci ¶àÖÖÓïÑÔ(Î÷Å·)
latin1_general_cs ¶àÖÖÓïÑÔ(Î÷Å·ISO),´óСдÃô¸Ð
latin1_spanish_ci ÏÖ´úÎ÷°àÑÀ
×îºóÎÒÃǽ«±í¸ñÖØ½¨£¬ÊÖ¹¤Ö¸¶¨±í¸ñ¼¶±ðµÄcollationΪlatin1_bin¡£
Õâ¸öÎÊÌâ¾ÍµÃµ½Á˽â¾ö¡£
ÄÇôÎÊÌâÓÖÀ´ÁË£¬ÎªÊ²Ã´ÎÒÇ°ÃæÊÖ¹¤²âÊÔlatin1_binʱ²»ÉúÐ§ÄØ£¿
Ô­À´MySQL°´ÕÕÏÂÃæµÄ·½Ê½Ñ¡Ôñ±í×Ö·û¼¯ºÍ У¶Ô¹æÔò£º
Èç¹ûÖ¸¶¨ÁËCHARACTER SET XºÍCOLLATE Y£¬ÄÇô²ÉÓÃCHARACTER SET XºÍCOLLATE Y¡£
Èç¹ûÖ¸¶¨ÁËCHARACTER SET X¶øÃ»ÓÐÖ¸¶¨COLLATE Y£¬ÄÇô²ÉÓÃCHARACTER SET XºÍCHARACTER SET XµÄĬÈÏУ¶Ô¹æÔò¡£
·ñÔò£¬²ÉÓ÷þÎñÆ÷×Ö·û¼¯ºÍ·þÎñÆ÷У¶Ô¹æÔò¡£
¶øÎÒÃÇÔÚ½¨±íµÄʱºòÖ¸¶¨ÁËcharacter set£¬ËùÒÔËüÓÀÔ¶ÊDzÉÓöÔÓ¦µÄĬÈϵÄУ


Ïà¹ØÎĵµ£º

MySQLÃüÁîÐÐÖÐÎÄÂÒÂëÎÊÌâ½â¾ö

ÎÊÌ⣺
1¡¢Êý¾Ý¿âĬÈϵÄ×Ö·û¼¯ÉèÖÃΪUTF-8£»
2¡¢Í¨¹ýibatis¶ÁдÊý¾ÝÖÐÎÄÕý³££»
3¡¢µ«ÊÇÓÃwindowsÃüÁîÐÐÖ´ÐÐselectÓï¾äÖÐÎÄÏÔʾÂÒÂë¡£
½â¾ö£º
Êý¾Ý¿âÓû§µÇ¼ʱ²ÎÊýÉ趨×Ö·û¼¯£º
mysql --default-character-set=gb2312 -u Óû§Ãû -p
£¨¹À¼ÆºÍwindowsµÄcmdÃüÁîÐÐÓйأ© ......

linuxÏ mysqlÓû§µÄ¹ÜÀí

linux
ÏÂ mysql
Óû§µÄ¹ÜÀí
ÎÄÕ·ÖÀà:Êý¾Ý¿â
¹Ø¼ü×Ö: linux
mysql
Óû§¹ÜÀí

×Ô´ÓÉÏÔÚredhat Enterprise 5 Öа²×°ÁËMySQL
,Õâ´ÎÀ´Êµ¼ù²Ù×÷Ò»ÏÂMySQL
Óû§µÄ¹ÜÀí£»
 Ò»¡¢rootÓû§ÃÜÂëµÄά»¤£º
       ÓÉÓÚ°²×°MySQL
Íêºó,MySQL
»á×Ô¶¯Ìṩһ¸ö²»´ø ......

MySQL Basic Knowledge

MySQL°æ±¾: Server version: 5.1.44 Source distribution
ÐÞ¸ÄrootÃÜÂë
Èç¹ûûÓÐÃÜÂëʹÓÃÏÂÃæµÄÃüÁî, ½«ÃÜÂëÉèΪ"123456"
$ mysqladmin -u root password 123456
Èç¹ûÓÐÃÜÂëʹÓÃÏÂÃæµÄÃüÁî, ½«ÃÜÂë¸ÄΪ"123456"
$ mysqladmin -u root -p password 123456
Enter password:
Óû§ÕË»§¹ÜÀí
Ìí¼ÓÕË» ......

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ÃÜÂë

ÓÉÓÚǰ¶Îʱ¼äÒªÓÃpowerdesignerÉè¼ÆÊý¾Ý¿â£¬¿ÉÊý¾Ý¿âÉè¼ÆºÃºóºÃµ¼ÈëMysQLʱÐèÒªODBCÁ¬½Ó£¬¶øMysQL5.0ÒÔÉϵľùÒªÐÞ¸ÄÃÜÂ루ÎÒÔÚÍøÉϲé¹ý£©£¬°´ËûÃǵÄÒâ˼ÐÞ¸ÄÁËrootÃÜÂ룬½á¹ûÊÇÖ±½Ó½ø²»ÁËMysQLÁË£¬ÎÒÄǸöÓôÃÆ£¬ÔÚÍøÉϲéÕÒ×ÊÁÏ£¬Ò²°´ËûÃǵķ½·¨×öÁË£¬¿É»¹ÊDz»ÐУ¨±¾È˶Ôdos²»Ê죩¡£µ«×îÖÕ»¹ÊÇ¿ÉÒÔÁË£¬ÏÂÃæËµÏ¾ßÌå·½·¨
1¡¢w ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ