解決mysql中文顯示,解決mysql中文

來源:互聯網
上載者:User

解決mysql中文顯示,解決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;語句也是正確的。

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

 

 

 

 

 

相關文章

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.