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

Code Example 1

1. sudo /etc/init.d/mysql restart

 2. # service mysql restart

Code Example 2

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