alpha-soso 2016-08-01 09:28 采纳率: 0%
浏览 1219

mysql在shell中导入导出问题

在写shell脚本遇到的问题
select * from student_test into outfile '/usr/test/accept/xx.csv' fields terminated by ','optionally enclosed by ''lines terminated by '/n';
这个语句,我把‘/usr/test/accept/xx.csv ’中的路径改成$path以后会报错,错误是这种
ERROR 1064 (42000) at line 7: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '/usr/test/accept/xx.csv fields terminated by ','optionally enclosed by ''lines t' at line 1

  • 写回答

2条回答 默认 最新

  • oyljerry 2016-08-01 10:13
    关注

    你先打印$path的内容,它应该是一组路径,你需要一个单独的路径。

    评论

报告相同问题?