• 导入转储文件的时候:Error Code: 1406. Data too long for column


    MySQL will truncate any insert value that exceeds the specified column width.

    to make this without error try Switch your MySQL mode to not use STRICT.

    here some docs


    EDIT:

    To change the mode

    This can be done in two ways:

    1. Open your "my.ini" file within the MySQL installation directory, and look for the text "sql-mode".

    Find:

    Code:

    # Set the SQL mode to strict 
    sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

    Replace with:

    Code:

    # Set the SQL mode to strict 
    sql-mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

    Or

    1. You can run an SQL query within your database management tool, such as phpMyAdmin:

    Code:

    SET @@global.sql_mode= '';
  • 相关阅读:
    VijosP1274:神秘的咒语
    2009年浙大 :找出直系亲属
    django用户信息扩展
    缓存
    自定义认证
    自定义admin
    权限的配置和使用
    form表单
    过滤器 自定义查询
    中间件
  • 原文地址:https://www.cnblogs.com/zhangwufei/p/6994546.html
Copyright © 2020-2023  润新知