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.
我想将 MySQL 查询结果保存到这样的文本文件中:
SELECT * FROM orders INTO OUTFILE '/data.txt'
但是,我在服务器上没有写权限。我在哪里可以写信或者有更简单的方法?
使用这个命令:
mysql -uroot -p -e "select * from database_name.table_name" > filename.txt
输入密码,一切就完成了
select * into outfile 'sd1.txt' from orders;
或者
select * into outfile 'sd1.sql' from orders;