1Using Homebrew:
2brew install mysql
3brew tap homebrew/services
4brew services start mysql
5mysqladmin -u root password 'secretpaSSw0rd'
6
7Using Docker:
8docker pull mysql/mysql-server
9docker run --name=mysql -d mysql/mysql-server
1brew install mysql
2
3sudo chown -R _mysql:mysql /usr/local/var/mysql
4sudo mysql.server start
5
6sudo mysql
7// set password for root user, or change root to another user
8ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
9FLUSH PRIVILEGES;
10
11exit
12mysql -u root -p
13
1alias mysqlstart='sudo /usr/local/mysql/support-files/mysql.server start'
2alias mysqlstop='sudo /usr/local/mysql/support-files/mysql.server stop'
3