Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个到远程 SQL 服务器的 SQL 连接,并且想运行一个查询,结果存储在一个输出文件中。问题是我想将文件本地保存在我的机器上。
我该怎么做呢?
Run the query, fetch the results in a array and store the array to a text file on your machine.
你可以运行这个:
mysql -hlocalhost -uroot -p -e "SELECT * FROM database.table;">C:\result.txt