我无法将数据从文件加载到MySQL表。
我还应该在哪里保存文件?
文件如下所示。
notroot@ubuntu:~/lab/data$ ls
txns
notroot@ubuntu:~/lab/data$ pwd
/home/notroot/lab/data
notroot@ubuntu:~/lab/data$ mysql -u root -p
mysql> load data infile '/home/notroot/lab/data/txns' into table trans fields terminated by ',' lines terminated by '\n';
ERROR 29 (HY000): File '/home/notroot/lab/data/txns' not found (Errcode: 13)
mysql> load data local infile '/home/notroot/lab/data/txns' into table trans fields terminated by ',' lines terminated by '\n';
ERROR 1148 (42000): The used command is not allowed with this MySQL version
mysql>
答案 0 :(得分:0)
运行--local-infile
mysql
参数
mysql --local-infile -u root -p