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

Hi,

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 ) persists.

I’ve moved this to the https://community.ubuntu.com/c/support-help-requests category because this site isn’t designed to take tech support questions. Sorry. I’d recommend using one of the official support channels listed on the https://community.ubuntu.com/t/finding-help/712 page.