1

I often keep a shell open to a remote server where I'm spending a lot of time in mysql. Exiting mysql and logging back in seems like a pain I shouldn't have to deal with if I just want to run a sql file.

When I'm running MySql from the command line, how can I run a dump file?

Right now, I'm using the same approach outlined in this post.

Community
  • 1
  • 1
doub1ejack
  • 10,627
  • 20
  • 66
  • 125

1 Answers1

1
mysql> use db_name;
mysql> source backup-file.sql;

You may want to take a look at this answer: https://stackoverflow.com/a/17666285

Community
  • 1
  • 1