码迷,mamicode.com
首页 > 数据库 > 详细

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

时间:2017-06-12 19:52:34      阅读:258      评论:0      收藏:0      [点我收藏+]

标签:tool   can   exce   server   ret   query   mode   pen   run   

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= ‘‘;

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

标签:tool   can   exce   server   ret   query   mode   pen   run   

原文地址:http://www.cnblogs.com/zhangwufei/p/6994546.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!