MySQL涓殑鍧�

涓�锛孖llegal mix of collations (gbk_bin,IMPLICIT) and (latin1_swedish_ci,COERCIBL

鍦∕ySQL涓婂啓浜嗕竴涓瓨鍌ㄨ繃绋嬶紝浣嗘槸鎴戝彂鐜扮敤#鍐欏畬涓枃娉ㄩ噴鍚庯紝鍦ㄤ繚瀛樻椂杩欎簺娉ㄩ噴浼氭秷澶便�傚湪瑙夊緱鍙兘鏄紪鐮侀棶棰樺鑷磋瘑鍒笉浜嗕腑鏂囪鍙ワ紝浜庢槸灏辩洿鎺ュ皢鏁版嵁搴撶殑缂栫爜淇敼鎴愪负浜唃bk锛屼絾鏄苟娌℃湁鑳藉淇杩欎釜闂銆�

鐩稿弽锛屽湪杩愯鍘熸湰姝e父鐨勫瓨鍌ㄨ繃绋嬫椂锛屽嚭鐜颁簡璇″紓鐨勬姤閿欙細Illegal mix of collations (gbk_bin,IMPLICIT) and (latin1_swedish_ci,COERCIBL...

鐧惧害涔嬪悗骞舵病鏈夊悎閫傜殑瑙e喅鍔炴硶锛岄槄璇讳簡stackoverflow涓婄殑杩欑瘒鍥炵瓟锛岄噷闈粙缁嶄簡MySQL鏈韩鐨勭紪鐮佸拰瀛楃姣旇緝浣撶郴锛宑ollation鐨勮瀹氫繚璇佷簡浣跨敤鏌愮缂栫爜浣撶郴鏃跺彲浠ユ甯歌繘琛屽瓧绗︿箣闂寸殑姣旇緝锛屽寘鎷琤in/cs/ci鍑犵锛屽垎鍒唬琛ㄤ簩杩涘埗瀛楃姣旇緝锛堝彲浠ユ瘮杈冧簩杩涘埗瀛楃鍜屾甯稿瓧绗︼紝澶у皬鍐欐晱鎰燂級銆佸ぇ灏忓啓鏁忔劅銆佸ぇ灏忓啓涓嶆晱鎰熶笁绉嶆瘮杈冩柟寮忋�傚悓鏃讹紝杩欎釜鍥炵瓟缁欏嚭浜嗕笅闈㈢殑鎻忚堪锛�

Literal expressions take the collation specified in the聽collation_connection聽system variable; values from tables take the collation specified in their column metadata.

琛ㄨ揪寮忎細浣跨敤绯荤粺榛樿鐨刢ollation_connection瀛楃姣旇緝璁惧畾锛岃�岃〃鍐呯殑鍊煎垯浼氶噰鍙栨渶鍒濆缓琛ㄦ椂缁欐瘡涓垪璁惧畾鐨勮瀹氥��

鎺ヤ笅鏉ワ紝鎴戜娇鐢ㄢ�渟how VARIABLES鈥濆懡浠ゆ煡鐪嬩簡绯荤粺瀵瑰簲鐨勫彉閲忥紝鎵惧埌collation_connection锛屽彂鐜板彇鍊间负latin1_swedish_ci锛岀寽娴嬪簲璇ユ槸涔嬪墠鍐欏瓨鍌ㄨ繃绋嬫椂锛岄粯璁や娇鐢ㄧ殑latin缂栫爜锛屼絾鏄悗闈㈡垜灏嗘暟鎹簱缂栫爜鏁翠綋淇敼涓轰簡gbk_bin锛屽鑷翠簡涓嶅悓姝ャ��


MySQL涓殑鍧�_第1张图片

鏈潵鍑嗗鏌ヤ竴涓嬫槸鍚︽湁鍔炴硶鍙互淇敼鈥渃ollation_connection鈥濓紝浣嗘槸鍙戠幇骞舵病鏈夌壒鍒究鍒╃殑瑙e喅鏂规銆�

浜庢槸锛屾垜灏辨妸鏁版嵁搴撶殑缂栫爜妯″紡鍥為��鍒颁簡鈥渓atin1鈥濓紝骞朵笖灏嗏�渃ollation_connection鈥濊缃负鈥渓atin1_swedish_ci鈥濓紝浜庢槸闂瑙e喅浜嗐��


浜屻�丮ySQL瀹㈡埛绔腑鐨勮秴鏃惰繛鎺ユ椂闂磋缃�

褰撶敤MySQL鏌ヨ姣旇緝澶х殑琛ㄦ椂锛屽鏋滀娇鐢ㄥ鎴风锛屼細鍑虹幇杩炴帴瓒呮椂鐨勬姤閿欐儏鍐碉紝杩欑鎯呭喌涓嬶紝鍙互淇敼瀹㈡埛绔笂鐨勮秴鏃舵椂闂淬�侻ySQL Workbench鍜孨avicat涓嶅悓銆�

MySQL Workbench锛�


MySQL涓殑鍧�_第2张图片

Navicat锛�

鍦ㄩ渶瑕佷慨鏀圭殑鏁版嵁搴撲笂鈥滃彸閿�->缂栬緫杩炴帴鈥�


MySQL涓殑鍧�_第3张图片

鏉′欢鍒ゆ柇涓殑NULL锛屽鏋滄槸鏌愪釜瀛楁鍙栧�糀涓篘ULL锛屽湪浣跨敤鏉′欢鈥淎<>'0' 鈥濅箣绫荤殑鏍煎紡鏃讹紝骞朵笉浼氳繑鍥濶ULL鐨勮锛岀洰鍓嶈繕涓嶆竻妤氬師鍥狅紝鐚滄祴鍙兘NULL鍜屾櫘閫氱殑鍙栧�间笉鍦ㄤ竴涓瘮杈冧綋绯婚噷闈紝杩欑鎯呭喌涓嬶紝濡傛灉鍙槸闇�瑕佽繑鍥濶ULL瀵瑰簲鐨勮锛屽氨鐢╥s NULL鍋氬垽鏂氨濂戒簡銆�

你可能感兴趣的:(MySQL涓殑鍧�)