cuốn sách gpt4 ai đã làm

mysql - 从 bash 输出 sql 输出

In lại Tác giả: Walker 123 更新时间:2023-11-29 01:29:45 27 4
mua khóa gpt4 Nike

tôi đang sử dụng OUTFILE 命令,但由于权限问题和安全风险,我想将 shell 的输出转储到文件中,但出现了一些错误。我试过的

#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

câu trả lời hay nhất

这是 heredoc 的错误输出重定向语法。

试试这个命令:

mysql -h "localhost" -u "XXXXXXX" "-pXXXXXX" standard_new2 << EOF > ./sample2.txt
select * from cnhdatad limit 10;
EOF

关于mysql - 从 bash 输出 sql 输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19726130/

27 4 0
Chứng chỉ ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com
Xem sitemap của VNExpress