Why mysql cmd wrapped with `nohup` and `&` still got `Terminal close -- query aborted` when I close terminal?

163 Views Asked by At

This is my command to import sql file into mysql 5.7.33, the sql has 10M lines so take some time to run:

nohup mysql -D bi -e "SET autocommit=0; SOURCE bi-6.sql; COMMIT;" &

I closed terminal after run this cmd, When I go back later, I saw Terminal close -- query aborted in nohup.out, and db is not fully imported, Why? I believe process is aborted when I close terminal.

I originally thought it should run in background until importing finish like normally when I run Python / Java program.

0

There are 0 best solutions below