1

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)

asked Dec 31, 2012 at 11:17

1 Answer 1

3

Start an interactive shell, then just do:

source in.sql

... 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.

answered Dec 31, 2012 at 17:19

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.