//data.txt为:"0001","大学英语","1001","12",
"0002","高等数学","1002","6",
"0003","马克思主义哲学","1003","2",
"0004","邓小平理论","1004","2",用load语句导入到course表中出现了下面的状况:
mysql> select * from course;
+------+-----------------------+------+---------+
| cno | cname | cpno | ccredit |
+------+-----------------------+------+---------+
| " | 大学英语 | 1001 | 12 |
| 0002 | 高等数学 | 1002 | 6 |
| 0003 | 马克思主义哲学 | 1003 | 2 |
| 0004 | 邓小平理论 | 1004 | 2 |
+------+-----------------------+------+---------+
4 rows in set (0.00 sec)我建立的course表结构是这样的:
mysql> create table course
-> (
-> cno char(4) primary key,
-> cname char(40),
-> cpno char(4),
-> ccredit smallint
-> );
Query OK, 0 rows affected (0.14 sec)不知道,为什么第一行的cno会变成 " ?warning 信息是:
| Warning | 1265 | Data truncated for column 'cno' at row 1 |
| Warning | 1262 | Row 1 was truncated; it contained more data than there were input columns |
| Warning | 1262 | Row 2 was truncated; it contained more data than there were input columns |
| Warning | 1262 | Row 3 was truncated; it contained more data than there were input columns |
+---------+------+---------------------------------------------------------------------------+
4 rows in set (0.00 sec)
"0002","高等数学","1002","6",
"0003","马克思主义哲学","1003","2",
"0004","邓小平理论","1004","2",用load语句导入到course表中出现了下面的状况:
mysql> select * from course;
+------+-----------------------+------+---------+
| cno | cname | cpno | ccredit |
+------+-----------------------+------+---------+
| " | 大学英语 | 1001 | 12 |
| 0002 | 高等数学 | 1002 | 6 |
| 0003 | 马克思主义哲学 | 1003 | 2 |
| 0004 | 邓小平理论 | 1004 | 2 |
+------+-----------------------+------+---------+
4 rows in set (0.00 sec)我建立的course表结构是这样的:
mysql> create table course
-> (
-> cno char(4) primary key,
-> cname char(40),
-> cpno char(4),
-> ccredit smallint
-> );
Query OK, 0 rows affected (0.14 sec)不知道,为什么第一行的cno会变成 " ?warning 信息是:
| Warning | 1265 | Data truncated for column 'cno' at row 1 |
| Warning | 1262 | Row 1 was truncated; it contained more data than there were input columns |
| Warning | 1262 | Row 2 was truncated; it contained more data than there were input columns |
| Warning | 1262 | Row 3 was truncated; it contained more data than there were input columns |
+---------+------+---------------------------------------------------------------------------+
4 rows in set (0.00 sec)
解决方案 »
- 一个表字段的递增如何实现?
- postgres 8.1.3 pg_clog 怎样清理
- MYSQL怎么用命令删除某个表的全部关联外键约束?
- mysqldump 导出指定行
- 如何把MYSQL中的语句嵌入到C语言中
- 请求帮助!!!!!!!!谢谢谢谢!!!!!!!!!!
- mysql 写存储过程,调试的时候能不能打一些信息
- 提问MYSQL语法
- 数据库多表查询,求帮忙拼一个sql语句
- sql 查询语句 如果字段不存在 怎么使得还能正常查询
- Starting MySQL.Manager of pid-file quit without updating fi[FAILED]
- mysql里面 如何通过SQL语句为某个已有字段添加自增属性
load data local infile '/home/kuzuozhou/桌面/data.txt' into table course fields terminated by ',' enclosed by '"' lines terminated by '\n';
UTF格式我注意了啊。。
问题解决了就结贴给分!
这是我的风格!