Just replace the db name, username & password and paste the code into your terminal.
Sure, you could use a client like phpMyAdmin, but this is faster.
Log into the terminal and type:-
You'll be prompted for your db password. Once entered, hey presto.
So, if I've got a database called “work”, my username is “guv”, my password is “abc”, my backup db is called “backup.sql” and located in a backup folder “/home/user/dbBackup/”, I could use something like this, below. (The one possible variable is the name of the backup file, which I can call whatever I like) ..
Prompted, after inputting the password, the import is facilitated and that's that.