Check out example codes for "execute mysql file". It will help you in understanding the concepts better.

Code Example 1

mysql -u yourusername -p yourpassword yourdatabase < text_file

Code Example 2

mysql> use db_name;
 mysql> source file_name.sql;

Learn ReactJs, React Native from akashmittal.com