`
Edward_Lee
  • 浏览: 46150 次
社区版块
存档分类
最新评论

解决data too long for column '' at row 1 的方法

阅读更多
向数据库中插入中文数据时,出现了data too long for column 'columnname' at row 1 的错误
问题产生原因:数据的字符编码问题
解决方法:
(1)修改 mysql安装根目录下的my.ini(MySQL Server Instance Configuration 文件),设置default-character-set=gbk(注意,有2处)
(2)在data目录下,打开相应数据库的文件,找到db.opt配置文件
设置default-character-set=gbk 
    default-collation=gbk_chinese_ci 
重启mysql就好了
分享到:
评论

相关推荐

    ERROR 1406 : Data too long for column 解决办法

    在MySQL数据库操作中,当你尝试插入或更新一行数据时,如果某个字段的值超过了该字段定义的最大长度,系统会抛出“ERROR 1406 : Data too long for column”的错误。这个错误提示非常直接,意味着你试图输入的数据在...

    MySql写入中文错误解决

    通过以上解决方案,我们可以正确地导入中文字符到 MySQL 中,无需再担心“Data too long for column XX at row n”的错误。同时,我们也需要了解 MySQL 的默认编码为 gb2312,并且需要在不同的场景下选择正确的编码...

    大牛总结 MySql常见错误集锦

    10. 错误1406: Data too long for column 'column_name' at row 1 插入的数据长度超过了列的最大允许长度。调整数据的大小,或者增大列的长度限制。 这些错误只是MySQL使用过程中可能遇到的一部分,理解和解决这些...

    微软内部资料-SQL性能优化5

    Each index row in node pages contains an index key (or set of keys for a composite index) and a ...at the next level for which the first key value is the same as the key value in the current index row....

    微软内部资料-SQL性能优化3

    In our example, if one transaction (T1) holds an exclusive lock at the table level, and another transaction (T2) holds an exclusive lock at the row level, each of the transactions believe they have ...

    MySQL text插入长文本时报错Incorrect string value xE5x8FxAC.pdf

    在本例中,报错信息为“Incorrect string value :'\xE5\x8F\xAC' for column 'XXX' at row 1”,这通常意味着尝试插入的文本包含了MySQL无法识别的字符编码,或者字段类型不能容纳特定的字符序列。 首先,我们需要...

    DevExpress VCL v2012 vol 1.6源码、例子、帮助-Part1

    Q440760 - Export to PDF - The File Save dialog is not shown if the default file name for a report is too long B218629 - In the Page Number Format dialog, the "Start At" field value is incorrectly ...

    DevExpress VCL 2012 vol 1.6源码、例子、帮助-Part1

    Q440760 - Export to PDF - The File Save dialog is not shown if the default file name for a report is too long B218629 - In the Page Number Format dialog, the "Start At" field value is incorrectly ...

    DevExpress VCL v2012 vol 1.6源码-例子-帮助-part1

    Q440760 - Export to PDF - The File Save dialog is not shown if the default file name for a report is too long B218629 - In the Page Number Format dialog, the "Start At" field value is incorrectly ...

    FastReport.v4.15 for.Delphi.BCB.Full.Source企业版含ClientServer中文修正版支持D4-XE5

    - improved split mechanism (added TfrxStretcheable.HasNextDataPart for complicated data like RTF tables) - improved crosstab speed when using repeat band with crosstab object version 4.9 ------------...

    DevExpress VCL v2012 vol 1.6源码、例子、帮助

    Q440760 - Export to PDF - The File Save dialog is not shown if the default file name for a report is too long B218629 - In the Page Number Format dialog, the "Start At" field value is incorrectly ...

    DevExpress VCL 2012 vol 1.6源码、例子、帮助-Part2

    Q440760 - Export to PDF - The File Save dialog is not shown if the default file name for a report is too long B218629 - In the Page Number Format dialog, the "Start At" field value is incorrectly ...

    DevExpress VCL v2012 vol 1.6源码、例子、帮助-part2

    Q440760 - Export to PDF - The File Save dialog is not shown if the default file name for a report is too long B218629 - In the Page Number Format dialog, the "Start At" field value is incorrectly ...

    DevExpress VCL v2012 vol 1.6源码-例子-帮助-part2

    Q440760 - Export to PDF - The File Save dialog is not shown if the default file name for a report is too long B218629 - In the Page Number Format dialog, the "Start At" field value is incorrectly ...

    探究MySQL中varchar的定义长度

    在上面的例子中,当尝试向`VARCHAR(10)`列插入`12345678901`时,由于超过了10个字节(10个英文数字字符共10字节),MySQL返回了`ERROR 1406 (22001): Data too long for column 'name' at row 1`错误。同样,当尝试...

    OutlookAttachView v2.73

    as you can delete unwanted large attachments that take too much disk space in your mailbox. You can also save the list of attachments into xml/html/text/csv file. System Requirements ==============...

    oracle学习文档 笔记 全面 深刻 详细 通俗易懂 doc word格式 清晰 连接字符串

    二进制数据类型 row 1~2000字节 可变长二进制数据,在具体定义字段的时候必须指明最大长度n long raw 1~2GB 可变长二进制数据 LOB数据类型 clob 1~4GB 只能存储字符数据 nclob 1~4GB 保存本地语言字符集数据 blob...

    Delphi7.1 Update

    ent_upd1.exe file appropriate for your locale.* To install this update from the Web, double-click the self-executing installation file and follow the prompts. * The Delphi 7 documentation PDF files ...

Global site tag (gtag.js) - Google Analytics