Check out example codes for "running external script mysql command". It will help you in understanding the concepts better.

Code Example 1

Copied shell> mysql db_name < text_file

Code Example 2

Copied mysql> source file_name
mysql> \. file_name

Learn ReactJs, React Native from akashmittal.com