doub1ejack
doub1ejack

Reputation: 11191

MySQL: How to import a sql dump.. inside mysql command line?

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.

Upvotes: 1

Views: 1506

Answers (1)

PixelOcelot_guest
PixelOcelot_guest

Reputation: 11

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

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

Upvotes: 1

Related Questions