mysql×Ö·ûÂÒÂ룿£¿£¿£¿£¿£¿£¿£¿£¿£¿£¿£¿
I promise this is gonna be the last time on it :-)
×Ô從寫ÍêÏÂÃæ兩ƪÎÄÕ£º
wordpress 1.5Éý級×¢ÒâÊÂ項 - ÖÐÎÄ亂碼ƪ
mysql 4.1ÖÐÎÄ亂碼µÚ¶þ擊
過È¥幾個Ô¾Ͳ»斷ÓÐ來ÐÅ詢問¸÷種 mysql ÖÐÎÄÏàÈݵÄ問題£¬ËùÒÔÓÐ機會¿´µ½許¶àÍæ¼Ò們Óõĸ÷ʽ連½Ó·¨與³Ìʽ£¬實ÔÚÌ«開Ñ۽硣
×î½üÒò為轉換µ½ flex 2×ö為開發ƽ̨並ÖØ寫һЩ產Æ·£¬許¶àÈ¥Äê寫µÄ framework ¾Í無·¨Ê¹Ó㬶øÆäÖÐÓв¿·Ý專門處Àí¶à國語ϵµÄlibraryÒ²隨֮ʧЧ£¬導ÖÂÎÒµÃÖØÐÂÃæ對這個問題£¬ËùÒÔÕýºÃ¼®´Ë機會將һЩÐÂÐĵÃÕûÀí³ö來¡£
£ªmysqlÖÐÎÄ亂碼µÄÔÒò
mysql 會³ö現ÖÐÎÄ亂碼µÄÔÒò²»ÍâºõÏÂÁÐ幾點£º
-mysql server±¾Éí設¶¨問題£¬ÀýÈç還Í£ÁôÔÚ latin1
-mysql table µÄ語ϵ設¶¨問題(°üº¬ character 與 collation)
-¿Í戶¶Ë³Ìʽ(ÀýÈç php) µÄ連線語ϵ設¶¨問題
ÔÚ֮ǰµÄ兩ƪÎÄÕÂÖÐÒѽé紹過ÈçºÎ設¶¨ mysql server/table µÄ character/collation¡£
½ÓÏÂ來Ö»ÐèÒª補³ä幾點×¢ÒâÊ£º
£ªmysqlÖÐÎÄ亂碼±Ø勝½â決·¨
1¡¢mysql 啟動時會讀È¡Ò»個預設µÄ config 檔£¬Ò»°ãÃû稱為 my.ini£¬¶øËü會µ½ÏÂÁÐ兩λÖÃÈ¥尋ÕÒ這個檔°¸£º
C:\windows\my.ini Ò²¾ÍÊÇ×÷業ϵ統µÄ°²裝Ä¿錄£¬Ò²ÓпÉÄÜÊÇ C:\winnt\my.ini
C:\:my.cnf Ò²¾ÍÊÇ C disk µÄ¸ùÄ¿錄
×¢ÒⲻͬλÖÃ裏µÄ檔°¸suffix²»Ò»樣£¬這點ÔÚ֮ǰµÄÎÄÕÂÖÐ沒ÓÐÌØ別強調£¬Òò´ËÄÇ時ÎÒÊÇÓøü複雜µÄ·½·¨Ö±½ÓÖØÐÂ將mysql 註冊µ½ service裏Ã棬並ÔÚÄÇ裏Ö¸¶¨ my.iniµÄλÖá£
2¡¢my.ini 裏µÄ內ÈÝ為£
Ïà¹ØÎĵµ£º
È¥mysqlµÄ¹Ù·½ÍøÕ¾ÏÂÔØodbc connector(http://dev.mysql.com/downloads/connector/odbc/3.51.html)
ÏÂÔصÄÊÇmysql-connector-odbc-noinstall-3.51.rar
½âѹºóÖ±½ÓÔËÐÐÎļþ¼ÐÖÐµÄ Install.bat Åú´¦ÀíÎļþ
mysql-connectorÓкü¸ÖÖ£¬Ñ¡ÔñÒ»¸ö×Ô¼ºÏ²»¶µÄ¼´¿É¡£
ÔÚxpÖдò¿ªODBCÊý¾ÝÔ´¹ÜÀíÆ÷£¨¿ØÖÆÃæ°å£¡·¹ÜÀí¹¤¾ß£¡·ODBCÊ ......
½â¾öÂÒÂë×îºÃµÄ·½·¨ÊÇÔÚÏîÄ¿Éè¼ÆÖ®³õ£¬Í³Ò»ËùÓеÄ×Ö·û¼¯£¬ÀýÈçÒ³Ãæ¡¢request¶ÔÏóÒÔ¼°Êý¾Ý¿âµÈµÈ¡£
Ò»¡¢
¼¸ÖÖ³£¼ûµÄÂÒÂëÏÖÏó£º
1¡¢Ò³ÃæÂÒÂë
µ¥´¿µÄÒ³ÃæÂÒÂëÊǺܺýâ¾öµÄ£¬Ö»ÒªÐÞ¸ÄÍ·²¿ÊʺϵÄ×Ö·û¼¯¼´¿É£¬Èç¹ûÒ³ÃæÖÐÎÄÏÔʾÂÒÂ룬Äã¿ÉÒÔ°Ñ×Ö·û¼¯ÐÞ¸ÄΪ£ºgb2312»ògbk¡£
2¡¢
Ò³ÃæÖ®¼ä´«µÝµÄ²Î ......
ÒÑÖªµ±Ç°¼Ç¼idΪ$id,È¡³öµ±Ç°¼Ç¼µÄÉÏÒ»Ìõ¼Ç¼ºÍÏÂÒ»Ìõ¼Ç¼µÄid,title×ֶΡ£±íÃûnews¡£
$sql = "SELECT CASE WHEN SIGN(id - $id) > 0 THEN MIN(id) WHEN SIGN(id - $id) < 0 THEN MAX(id) END AS id,title from news WHERE id <> $id GROUP BY SIGN(id - $id) ORDER BY SIGN(id - $id)"; ......
¼ÌTwitterÖ®ºó£¬Éç½»ÐÂÎÅÍøÕ¾Digg¾ö¶¨¸úMySQL˵ÔÙ¼û£¬²¢Ìæ»»µôËüµÄ´ó²¿·Ö»ù´¡ÉèÊ©×é³É£¬Digg½«´ÓLAMP£¨Linux¡¢ Apache¡¢MySQLºÍPerl/PHP/Python£©¼Ü¹¹Ç¨ÒƵ½»ùÓÚCassandraµÄNoSQL¼Ü¹¹¡£
¡¡¡¡Apache CassandraÊÇÒ»Ì׿ªÔ´·Ö²¼Ê½Êý¾Ý¿â¹ÜÀíϵͳ£¬×î³õÓÉFacebook¿ª·¢£¬ÓÃÓÚ´¢´æÌرð´óµÄÊý¾Ý¡£Cassa ......
LOCK TABLES/UNLOCK TABLES ¾ä·¨
LOCK TABLES tbl_name [AS alias] {READ [LOCAL] | [LOW_PRIORITY] WRITE}
[, tbl_name [AS alias] {READ [LOCAL] | [LOW_PRIORITY] WRITE} ...]
...
UNLOCK TABLES
LOCK TABLES Ϊµ±Ç°Ïß³ÌËø¶¨±í¡£UNLOCK TABLES Êͷŵ±Ç°Ïß³ÌÓµÓеÄËùÓÐËø¶¨¡£µ±Ï̷߳¢³öÁíÒ»¸ö LOCK TABLES£¬»òµ±Óë·þ ......