A file, in.sql, contains a CREATE TEMPORARY TABLE statement followed by some INSERTs that populate the above table. Temporary tables are purged after the session closes, so 'mysql -u user -p pass < in.sql' has no net effect once the mysql process is done with in.sql and terminates. I would like to keep the session open to continue working on the temporary table interactively. Does such an option exist? (A simple workaround, of course, would be to create a non-temporary table and drop it when I'm done with it)
Start an interactive shell, then just do:
... at the mysql prompt. The session will still be open after the file is executed, unless the file has a command in it that causes the mysql shell to exit.