在mysql中输入以下语句:
load data local infile 'User.txt' into table User;
提示如下:
ERROR 2 (HY000): File 'User.txt' not found (Errcode:2)
但是路径没错呀,我确实是把User.txt文件放到mysql数据库文件下的data 文件夹下,
请各位高手指点,本人初学这个
load data local infile 'User.txt' into table User;
提示如下:
ERROR 2 (HY000): File 'User.txt' not found (Errcode:2)
但是路径没错呀,我确实是把User.txt文件放到mysql数据库文件下的data 文件夹下,
请各位高手指点,本人初学这个
mysql> create database 数据库名;
mysql>use 数据库名;然后使用source命令,后面参数为脚本文件
mysql>source 绝对路径/User.txt;
Query OK,4 rows affected,20 warnings <0.02 sec>
Records:4 Deleted: 0 Skipped: 0 Warnings: 19
我查看插入后的数据都为 NULL
create table user(id int(10),name varchar(100),tel varchar(100),educational varchar(100),date date));
user.txt 文件内容如下:
1 张三 13333663366 大专毕业 2006-10-11
3 张三 13612312331 本科毕业 2006-10-15
5 张四 020-5566556 中专毕业 2006-10-15
4 王五 13521212125 大专毕业 2006-12-25
use test;
load data local infile '/user.txt' into table user;
提示:
Query OK,4 rows affected,20 warnings <0.02 sec>
Records:4 Deleted: 0 Skipped: 0 Warnings: 19
查看表中导入数据为 NULL
http://topic.csdn.net/u/20090501/15/7548d251-aec2-4975-a9bf-ca09a5551ba5.html