Check out example codes for "how to start my sql server on mac". It will help you in understanding the concepts better.

Code Example 1

alias mysqlstart='sudo /usr/local/mysql/support-files/mysql.server start'
alias mysqlstop='sudo /usr/local/mysql/support-files/mysql.server stop'

Learn ReactJs, React Native from akashmittal.com