I know there're tons similar question but somehow I can't get it right.
When run this command, my "dump.sql" produced desired result
mysqldump -uuser -ppassword --comments --single-transaction --quick mydb desired_table | gzip >dump.sql.gz
This is the first line of dump.sql
-- MySQL dump 10.13 Distrib 8.0.21, for Linux (x86_64)
But with this command:
nohup mysqldump -uuser -ppassword --comments --single-transaction --quick mydb desired_table | gzip >dump.sql.gz 2>/dev/null &
This is the first line of dump.sql:
mysqldump: [Warning] Using a password on the command line interface can be insecure.
Which will cause error when import the dump file. How? From what I understand, "2>" means redirect error. If I change to this command, nothing in the "dump.log":
nohup mysqldump -uuser -ppassword --comments --single-transaction --quick mydb desired_table | gzip >dump.sql.gz 2>dump.log &