0

Is it possible to run a mysql command async in bash? I tried the & operator at the end, but his causes the process to hang and not quit when the select finished.

Example:

export MYSQL_PWD=rootpw; mysql --user=root --database=my_table -e "SELECT 1" &

Running this command succeeds immediately without the &. And with the & operator, it hangs and never exits. Why?

My goal is to trigger a long running table truncate (and other cleanup commands) while another aggregation process should already start before the truncate finished.

membersound
  • 81,582
  • 193
  • 585
  • 1,120

0 Answers0