日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問(wèn)題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷解決方案
教您如何將不同的MySQL字符集轉(zhuǎn)化成統(tǒng)一的字符集

下面為您介紹的MySQL字符集處理方法是將不同的MySQL字符集,轉(zhuǎn)化成統(tǒng)一的字符集。 該方法供您參考,希望對(duì)您學(xué)習(xí)MySQL字符集方面能有所啟迪。

創(chuàng)新互聯(lián)公司主營(yíng)河南網(wǎng)站建設(shè)的網(wǎng)絡(luò)公司,主營(yíng)網(wǎng)站建設(shè)方案,成都App定制開(kāi)發(fā),河南h5小程序制作搭建,河南網(wǎng)站營(yíng)銷推廣歡迎河南等地區(qū)企業(yè)咨詢

 
 
 
  1. After   an   upgrade   to   MySQL   4.1,   the   statement   fails:      
  2. mysql>   SELECT   SUBSTRING_INDEX(USER(),'@',1);    
  3. ERROR   1267   (HY000):   Illegal   mix   of   collations    
  4. (utf8_general_ci,IMPLICIT)   and   (latin1_swedish_ci,COERCIBLE)    
  5. for   operation   'substr_index'    
  6. The   reason   this   occurs   is   that   usernames   are   stored   using   UTF8   (see   section   11.6   UTF8   for   Metadata).   As   a   result,   the   USER()   function   and   the   literal   string   '@'   have   different   character   sets   (and   thus   different   collations):      
  7. mysql>   SELECT   COLLATION(USER()),   COLLATION('@');    
  8. +-------------------+-------------------+    
  9. |   COLLATION(USER())   |   COLLATION('@')         |    
  10. +-------------------+-------------------+    
  11. |   utf8_general_ci       |   latin1_swedish_ci   |    
  12. +-------------------+-------------------+    
  13. One   way   to   deal   with   this   is   to   tell   MySQL to   interpret   the   literal   string   as   utf8:      
  14. mysql>   SELECT   SUBSTRING_INDEX(USER(),_utf8'@',1);    
  15. +------------------------------------+    
  16. |   SUBSTRING_INDEX(USER(),_utf8'@',1)   |    
  17. +------------------------------------+    
  18. |   root                                                               |    
  19. +------------------------------------+    
  20. Another   way   is   to   change   the   connection   character   set   and   collation   to   utf8.   You   can   do   that   with   SET   NAMES   'utf8'   or   by   setting   the   character_set_connection   and   collation_connection   system   variables   directly.      

表的編碼轉(zhuǎn)換可以用:(MySQL   Version   >   4.12)

 
 
 
  1. ALTER   TABLE   tbl_name   CONVERT   TO   CHARACTER   SET   charset_name;    

之前的版本可以用:

 
 
 
  1. ALTER   TABLE   tbl_name   CHARACTER   SET   charset_name; 

當(dāng)前名稱:教您如何將不同的MySQL字符集轉(zhuǎn)化成統(tǒng)一的字符集
轉(zhuǎn)載注明:http://m.5511xx.com/article/dhcdooj.html