MySQL SELECT INTO OUTFILE to a different server?

前端 未结 2 1219
悲哀的现实
悲哀的现实 2020-12-18 00:17

I have a shell script on server a. The script spits out a csv file to a local directory. The problem is the database server is on server b. How do I use select * int

2条回答
  •  抹茶落季
    2020-12-18 00:43

    Use the command below:

    mysql -uusername -ppassword -h DBIP DBNAME -e \
    "SELECT * FROM tablename" > /destinationpath/outputfilename.csv
    

提交回复
热议问题