install mysql mac from terminal code example
Example 1: mac install mysql
brew install mysql
sudo chown -R _mysql:mysql /usr/local/var/mysql
sudo mysql.server start
sudo mysql
// set password for root user, or change root to another user
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
FLUSH PRIVILEGES;
exit
mysql -u root -p
Example 2: how to start mysql in terminal mac
mysql -u root -p