当前位置:网站首页>MySQL error resolution - error 1261 (01000): row 1 doesn't contain data for all columns

MySQL error resolution - error 1261 (01000): row 1 doesn't contain data for all columns

2022-07-04 07:11:00 Become a person in the book

Report a mistake :

    Error occurs when importing data !

mysql> load data infile "/myload/passwd"

    -> into table tu.user

    -> fields terminated by ":"

    -> lines terminated by "\n";

ERROR 1261 (01000): Row 1 doesn't contain data for all columns

Cause analysis :

        because sql_mode Set to strict Pattern , To continue importing, you need to “strict_trans_tables” from sql_mode Removing the .

resolvent :

mysql> show variables  like  "sql_mode"\G;                                // Query parameter value 
*************************** 1. row ***************************
Variable_name: sql_mode
        Value: ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
1 row in set (0.00 sec)

mysql>  set sql_mode='ONLY_FULL_GROUP_BY,NO_ZERO_IN_DATE,                    // Change the value of the parameter 
     > NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,
     > NO_ENGINE_SUBSTITUTION';
Query OK, 0 rows affected, 1 warning (0.00 sec)
 perhaps 
mysql>  set  sql_mode=‘ ’;

# Re import validation !
mysql> load data infile "/myload/passwd"  into table tu.user fields terminated by ":" lines terminated by "\n";
Query OK, 21 rows affected, 128 warnings (0.01 sec)
Records: 21  Deleted: 0  Skipped: 0  Warnings: 128

result :

Successful import , Problem solving !

原网站

版权声明
本文为[Become a person in the book]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202141543334371.html