MySQL出現data too long for column 'name' at row 1 解決

來源:互聯網
上載者:User

MySQL出現data too long for column 'name' at row 1 解決

1、現象:我們把資料庫的字元集編碼設定為utf-8,我們通過DOS介面向表的某一列插入漢字時會遇到類似

data too long for column 'name' at row 1

的錯誤。

2、錯誤原因:

3、解決的辦法:

(1)set names gbk;(只對當前視窗有效)

(2)找到mysql的安裝目錄,把檔案my.ini裡的“default-character-set=utf8”修改為“default-character-set=gbk”,然後重啟mysql服務

本文永久更新連結地址:

相關文章

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.