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

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

已经解决了,原来要写成 ‘$path'这种,就能正常运行了