Home  >  Q&A  >  body text

mysql只能插入特定的中文字符,什么原因?

怪我咯怪我咯2719 days ago578

reply all(4)I'll reply

  • 天蓬老师

    天蓬老师2017-04-17 15:49:19

    Is the encoding of your database utf8?
    Change the encoding to utf8mb4 and give it a try

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-17 15:49:19

    I guess your shell window does not support utf8.

    But I set the encoding to utf8.

    The client sent gbk. But the server understood it as utf8. So an error was reported.

    reply
    0
  • 迷茫

    迷茫2017-04-17 15:49:19

    Portal
    Coding:
    Mei C3B7
    生C9FA

    Then please see the discussion in the portal for details.

    reply
    0
  • ringa_lee

    ringa_lee2017-04-17 15:49:19

    Thank you everyone for your answers, the problem has been solved. After modifying the character set, I still cannot insert Chinese characters. This is because my database and tables were created before the character set was modified. After the modification, I re-created the database and table, and I can insert normally. Later, I checked the encoding of the database and table, and sure enough I found that the encoding of the attribute was latin1.

    reply
    0
  • Cancelreply