$ mysql --version
zsh: command not found: mysql
Install with homebrew. Check this note( Install homebrew, nvm, node to Mac ) if homebrew is not installed.
mysql --version
mysql Ver 8.0.31 for macos12.6 on x86_64 (Homebrew)
$ mysql.server start
Starting MySQL
. SUCCESS!
Let's check if MySQL can be used as root user and check if MySQL is working
$ mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.31 Homebrew
Copyright (c) 2000, 2022, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
mysql> quit
Bye
$ mysql.server stop
Shutting down MySQL
. SUCCESS!
$ mysql.server restart
Shutting down MySQL
. SUCCESS!
Starting MySQL
. SUCCESS!