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)
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:
Here's how it works:
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
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.