I would like to know how to retrieve a file using Vi in MySQL. I logged in using:
mysql -uuser -p -hserver -A database
Then I do:
\e
The editor opens and I type my query of 200 lines, then I :wq
and \G
(if I save the file it says: /tmp/sql9SbYQZ saved
) and I see the result.
Now, if I make a mistake or run a different query and I try to type \e
again, the query is lost.
ll /tmp/sql9SbYQZ
ls: /tmp/sql9SbYQZ: No such file or directory
Is there a way to retrieve the lost file?