zoukankan      html  css  js  c++  java
  • mysql报错: DataError: (pymysql.err.DataError) (1406, "Data too long for column 'name' at row 746")

    报错内容:

    DataError: (pymysql.err.DataError) (1406, "Data too long for column 'name' at row 746")
    [SQL: INSERT INTO index_basic (ts_code, name, market, publisher, category, base_date, base_point, list_date) VALUES (%(ts_code)s, %(name)s, %(market)s, %(publisher)s, %(category)s, %(base_date)s, %(base_point)s, %(list_date)s)]
    [parameters: ({'ts_code': '105653.MI', 'name': 'MSCI俄罗斯', 'market': 'MSCI', 'publisher': 'MSCI', 'category': '规模指数', 'base_date': '19941230', 'base_point': 100.0, 'list_date': None}, {'ts_code': '105765.MI', 'name': 'MSCI摩洛哥', 'market': 'MSCI', 'publisher': 'MSCI', 'category': '规模指数', 'base_date': '19941230', 'base_point': 100.0, 'list_date': None}, {'ts_code': '105766.MI', 'name': 'MSCI埃及', 'market': 'MSCI', 'publisher': 'MSCI', 'category': '规模指数', 'base_date': '19941230', 'base_point': 100.0, 'list_date': None}, {'ts_code': '105767.MI', 'name': 'MSCI印度尼西亚', 'market': 'MSCI', 'publisher': 'MSCI', 'category': '规模指数', 'base_date': '19871231', 'base_point': 100.0, 'list_date': None}, {'ts_code': '105768.MI', 'name': 'MSCI马来西亚', 'market': 'MSCI', 'publisher': 'MSCI', 'category': '规模指数', 'base_date': '19871231', 'base_point': 100.0, 'list_date': None}, {'ts_code': '105769.MI', 'name': 'MSCI泰国', 'market': 'MSCI', 'publisher': 'MSCI', 'category': '规模指数', 'base_date': '19871231', 'base_point': 100.0, 'list_date': None}, {'ts_code': '105771.MI', 'name': 'MSCI澳大利亚成长', 'market': 'MSCI', 'publisher': 'MSCI', 'category': '成长指数', 'base_date': '19741231', 'base_point': 100.0, 'list_date': None}, {'ts_code': '105772.MI', 'name': 'MSCI澳大利亚价值', 'market': 'MSCI', 'publisher': 'MSCI', 'category': '价值指数', 'base_date': '19741231', 'base_point': 100.0, 'list_date': None} ... displaying 10 of 3236 total bound parameter sets ... {'ts_code': '999100.MI', 'name': 'MSCI欧洲(除爱尔兰)', 'market': 'MSCI', 'publisher': 'MSCI', 'category': '规模指数', 'base_date': '19930430', 'base_point': 100.0, 'list_date': None}, {'ts_code': '999902.MI', 'name': 'MSCI欧洲&中东新兴市场', 'market': 'MSCI', 'publisher': 'MSCI', 'category': '规模指数', 'base_date': '19871231', 'base_point': 100.0, 'list_date': None})]
    (Background on this error at: http://sqlalche.me/e/9h9h)

    原因:
      字段的长度不够存放数据

    解决方案:
      就是更改mysql中name 字段的max_length 的长度
           原来设置的是varchar(20)

    修改字段长度命令:

      alter table 表名 modify column 列名 类型(要修改的长度);

      alter table tushare.index_basic modify column name varchar(60);

  • 相关阅读:
    windows线程消息通信和处理 PostThreadMessage和PeekMessage GetMessage
    如何:对 Windows 窗体控件进行线程安全调用(转载自msdn)
    How to: Develop a Simple Windows Forms Control(转载)
    《Effective C#》 翻译札记(转载)
    对制造者线程和使用者线程进行同步
    用户模式与内核模式(转)
    焊接技巧
    TextBox控件滚动条自动下拉(转)
    books
    CODE::BLOCKS GLUT 完整开发包
  • 原文地址:https://www.cnblogs.com/ttrrpp/p/12611815.html
Copyright © 2011-2022 走看看