Check out example codes for "restart mysql mac command line". 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'

Code Example 2

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

 2. # service mysql restart

Code Example 3

# mysql start/stop/restart
# MAC
$ cd /Applications/Ampps/mysql/bin
$ mysql.server restart
#Linux
$ /etc/init.d/mysqld restart
or
$ service mysqld restart
or
$ systemctl restart mysqld

Learn ReactJs, React Native from akashmittal.com