我正在尝试以 csv 格式将表格从远程服务器导出到我的台式计算机。我有这个代码:
select * from order
into outfile 'C:\Users\Sleep Shop\Desktop\MySQL Scripts/outfile.csv'
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
ESCAPED BY '\\'
LINES TERMINATED BY '\n';
但我收到此错误:
失败:无法创建/写入文件“/var/lib/mysql/C:\Users\Sleep Shop\Desktop\MySQL Scripts/outfile.csv”(错误代码:2)
我在想这个过程有一些我不了解的基本内容,可能是在远程服务器上做表。任何人都可以帮忙吗?
我用这段代码告诉服务器上的一个点来创建文件:
select * from orders
into outfile '/var/www/test/outfile.csv'
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
ESCAPED BY '\\'
LINES TERMINATED BY '\n';
它创建文件,但不包含任何记录,我收到此错误:
failed :字段分隔符参数不是预期的;