Just a simple command to handle this. First go to the location where your file is placed and then execute this command. In my case DB username is “root” and password is “toor”. One important thing to remember is there should be no space between “-p” and “DB password”.

mysql -u username -ppassword db_name < xyz.sql
mysql -u root -ptoor db_name < xyz.sql