brew install mysql
brew cask install mysqlworkbench

and install to start on restart

brew services start mysql

Connect with
mysql -u root
Or connect with host name

mysql -h -u root -p    

Show databases
show databases;
Show tables
use myDb; show tables;

Show users :

select user,host from mysql.user;

Create a database with
CREATE DATABASE example; CREATE USER 'example'@'localhost' IDENTIFIED BY 'example'; GRANT ALL PRIVILEGES ON example.* TO 'example'@'localhost'; FLUSH PRIVILEGES;


If you need to upgrade MySQL install :
brew upgrade mysql mysql_upgrade -uroot --force

Run MySQL service in shell

To run in local shell without starting on restart

mysql.server start