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

Code Example 1

Using Homebrew:
brew install mysql
brew tap homebrew/services
brew services start mysql
mysqladmin -u root password 'secretpaSSw0rd'

Using Docker:
docker pull mysql/mysql-server
docker run --name=mysql -d mysql/mysql-server

Code Example 2

install mysql server on mac

Learn ReactJs, React Native from akashmittal.com