starting mysql on mac code example

Example 1: install mysql on mac

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

Example 2: start mysql server mac

sudo mysql.server start

Example 3: how to start my sql server on mac

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