当执行“select * from sometable into outfile 'c:/somefile.txt'”这样的语句时,如何在查询远程数据库服务器时将输出文件获取到客户端系统。是否有另一个命令可以实现这一点。有人可以给出完整的命令或步骤列表吗?提前致谢。
最佳答案
The SELECT ... INTO OUTFILE statement is intended primarily to let you very quickly dump a table to a text file on the server machine. If you want to create the resulting file on some other host than the server host, you normally cannot use SELECT ... INTO OUTFILE since there is no way to write a path to the file relative to the server host's file system.
However, if the MySQL client software is installed on the remote machine, you can instead use a client command such as mysql -e "SELECT ..." > file_name to generate the file on the client host.
关于mysql - 查询远程数据库服务器时如何将 mysql OUTFILE 获取到客户端计算机,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6052058/