Go to
https://dev.mysql.com/downloads/
choose x86 for intel, ARM for M1
Download & Proceed
If macos prevents you from opening the download, follow the procedure in below link.
https://support.apple.com/ko-kr/guide/mac-help/mh40616/mac
After installing, connect to mysql
mysql -u root -p
then type password.
If it says command not found, update your path variable
export PATH=${PATH}:/usr/local/mysql-8.0.31-macos12-x86_64/bin
then try again.