首页 > 代码库 > 导入转储文件的时候:Error Code: 1406. Data too long for column - MySQL
导入转储文件的时候:Error Code: 1406. Data too long for column - MySQL
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:
- 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
- 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
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。