MySQL too long varchar truncation/error setting

后端 未结 3 1429
没有蜡笔的小新
没有蜡笔的小新 2020-11-28 10:06

I have two MySQL instances. The 1st one truncates strings on insert when data is too long. The 2nd one raises an error:

ERROR 1406 (22001): Data too long for c

3条回答
  •  南笙
    南笙 (楼主)
    2020-11-28 10:13

    if you use cpanel ,

    replace

    sql-mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
    

    into /usr/my.cnf

    to

    sql-mode=""
    

    run

    /etc/init.d/mysql restart
    

提交回复
热议问题