解決mysql中文顯示

來源:互聯網
上載者:User

標籤:mysql   中文設定   

1、查看mysql字元設定方式:如所示如若不是gbk,則進行相關設定

mysql>SET character_set_client =gbk  ;
mysql>SET character_set_connection = gbk;
mysql>SET character_set_database = gbk ;
mysql>SET character_set_results = gbk ;
mysql>SET character_set_server = gbk ;
mysql>SET collation_connection = gbk_bin;
mysql>SET collation_database = gbk_bin; 
mysql>SET collation_server = gbk_bin ;

 

2、選擇資料庫,選擇表設定,如

3但問題是顯示還是錯誤,嘗試:SELECT ‘工資合計‘,SUM(FSalary) FROM T_Employee;語句;

此時又是顯示正確的,後來就在想是不是union的問題,於是又進行嘗試  :SELECT ‘正式員工最高年齡‘,MAX(FAge) as ‘年齡‘ FROM T_Employee UNION SELECT ‘正式員工最低年齡‘,MIN(FAge) FROM T_Employee;語句也是正確的。

原以為是欄位類型設定問題,嘗試後依然不對。現在也不知道為什麼了。

 

 

 

 

 

解決mysql中文顯示

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.