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.
我正在使用OUTFILE 命令,但由于权限问题和安全风险,我想将 shell 的输出转储到文件中,但出现了一些错误。我试过的
OUTFILE
#This is a simple shell to connect to mysql db cat mysql -h "localhost" -u "XXXXXXX" "-pXXXXXX" standard_new2 << EOF select * from cnhdatad limit 10; EOF ./sample2.txt
这是heredoc 的错误输出重定向语法。
试试这个命令:
mysql -h "localhost" -u "XXXXXXX" "-pXXXXXX" standard_new2 << EOF > ./sample2.txt select * from cnhdatad limit 10; EOF