Using `nohup` to Import MySQL Dump on Debian Server
sudo
probably asks for a password and nohup disconnects the process from the controlling terminal. Use that instead:
sudo sh -c 'nohup mysql -hlocalhost -P3306 -uxxxxxx -pxxxxxx < /var/lib/mysql/backups/dump.sql &'
I 'may' have solved this by leaving out the &
, and then running nohup . . .
, then pressing ctrl-z
, then exiting from putty.
So far the MySQL connection appears to be still running
First, switch to root with
sudo -i
Then,
nohup sh -c 'mysql -hlocalhost -P3306 -uxxxxxx -pxxxxxx < /var/lib/mysql/backups/dump.sql' &