Home > database >  how to run mysql command with nohup
how to run mysql command with nohup

Time:12-16

could someone assist me to run this query with nohup, how should I do? with the below command, I faced an error

nohup mysql -u -p -A tablename " select distinct t2.white, t1.red from table t1 inner join temp t2 on t1.Data=t2.white INTO OUTFILE '/tmp/test.csv'   LINES TERMINATED BY '\n';" &

CodePudding user response:

please try

nohup mysql -u -p -A tablename " select distinct t2.white, t1.red from table t1 inner join temp t2 on t1.Data=t2.white INTO OUTFILE '/tmp/test.csv'   LINES TERMINATED BY '\n';" 2>&1 &

CodePudding user response:

When no redirection output is added after the nohup command, "nohup: ignoring inpu... " will be printed by default and then exit. The actual command is already running in the background.

You can use to increase the redirection command, nohup will not output the ignorein error.

nohup xxx> /tmp/nohup.log & 

You should check if your sql file is generated;

  • Related