- 积分
- 16840
在线时间 小时
最后登录1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?开始注册
x
mysql> load data infile '/etc/passwd' into table gz.six fields terminated by ':' lines terminated by '\n';
' \: ]9 H3 `3 qERROR 1406 (22001): Data too long for column 'shell' at row 2 W8 p0 g9 j, {; j; e# H3 u$ o8 E2 h
7 c- [; q [+ [% Y
( F( ?/ Q; @% }" F$ Y" m. umysql> load data infile '/etc/passwd' into table gz.six fields terminated by ':' lines terminated by '\n';
4 B. _) o. t$ Q2 O; Y' C6 L' eERROR 1406 (22001): Data too long for column 'shell' at row 24 l/ I$ F' i9 _! [; K8 ~
6 x! l g) c. c. o( W; F
Records: 0 Duplicates: 0 Warnings: 0
9 ]. z! O( d- Z) }. {0 U" H. i; z6 L, V( v
ERROR 1406 (22001): Data too long for column 'shell' at row 2
; h6 N4 b; z0 G$ b+ j2 q6 ~报错提示字符太长,导致数据容量过大。
f3 p g7 [( r* R+ e, d解决办法:3 b) D+ ~$ b) i! M$ M) l/ d1 J
modify 修改字段类型' Y7 I' j3 `" R! Z) F* u4 U
modify 字段名 类型(宽度) 约束条件 , modify 修改个多个在后面田间,modify
# f# _! W8 d6 _: K. Fmysql> alter table six modify shell varchar(50);
1 Y* ]0 c3 N# W) K, P6 U% ]# ~( U' b1 M1 _+ |' r# [0 W
Query OK, 0 rows affected (1.85 sec)# ?9 S. }. W( n! D5 y6 p, N% ?. G
Records: 0 Duplicates: 0 Warnings: 0
4 w/ b4 a8 d/ f; ~% g) ^/ l9 U" e, F9 D/ M7 X
mysql> alter table six modify shell varchar(50);
7 Z" n% u8 C* h0 }7 FQuery OK, 0 rows affected (1.85 sec)
! T- W) \4 u6 W3 D$ ] Y
/ T+ g; a* L8 P+ q# `% ~/ K' fmysql> load data infile '/etc/passwd' into table gz.six fields terminated by ':' lines terminated by '\n';) m* _& ?8 S3 T) c! C" ?- b
Query OK, 24 rows affected (0.29 sec)$ F# s8 s$ D E n0 O( t
Records: 24 Deleted: 0 Skipped: 0 Warnings: 0
5 G3 C( @& J# F% j3 y0 L$ x& ~- g. O/ u/ _$ S: D! m6 O$ ^( @8 G. o; X
|
|