我想从x到输出文件’c:/test.csv’中进行选择*.
但是,我不想将其保存到outfile test.csv中,而是将其保存到blob字段中.
我正在从Windows上的客户端开始查询.
MySQL服务器在Windows或Linux(可以是两者)上的服务器上.
但是我想让文件在客户端,而不是在服务器上.
BTW
该客户端软件是用Delphi 2007编写的,并使用ZEOS连接到远程服务器上的MySQL数据库.
如何获得Outfile客户端而不是服务器端?
解决方法:
Johan,MySql从正在运行的服务器执行此语句.在客户端创建文件的唯一方法是传递指向客户端计算机的共享文件夹位置和文件名. MySQL服务(守护程序)所有者还必须具有足够的特权才能写入目标目录.
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.
It is also possible to create the
resulting file on a different host
other than the server host, if the
location of the file on the remote
host can be accessed using a
network-mapped path on the server’s
file system. In this case, the
presence of mysql (or some other MySQL
client program) is not required on the
target host.
标签:zeos,windows,mysql,delphi,delphi-2007
来源: https://codeday.me/bug/20191102/1993495.html