How to store STDOUT buffer of `mysql_secure_installation` to a file

寵の児 提交于 2019-12-11 19:35:29

问题


I want to append STDOUT or STDERR of command mysql_secure_installation to a file for example /tmp/output.txt but no success on below commands:

mysql_secure_installation >> /tmp/output.txt
mysql_secure_installation 1>> /tmp/output.txt
mysql_secure_installation 2>> /tmp/output.txt

Also tested STDIN and reserved buffers by below commands:

mysql_secure_installation 0>> /tmp/output.txt
mysql_secure_installation 3>> /tmp/output.txt
...
mysql_secure_installation 9>> /tmp/output.txt

It seems mysql_secure_installation output buffers is many different from other commands and it's buffer cannot accessible. Is this true and how to handle it?

UPDATE 1:

CentOS tested and buffer works perfect but on my target os ( Ubuntu 16.04 LTS ) it doesn't work.

UPDATE 2:

Worked on Debian 9 too, but problem on ( Ubuntu 16.04 LTS ) exists.

来源:https://stackoverflow.com/questions/47087442/how-to-store-stdout-buffer-of-mysql-secure-installation-to-a-file

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!