Use official installer.
MySQL - Official Download page: https://dev.mysql.com/downloads/mysql/
The root means the MySQL root user, not your macOS You should take a memo your password of root user (not Linux system super user.)
After running installer, add the PATH to ~/.zshrc
(or your shell. Check with $echo SHELL
).
alias mysql=/usr/local/mysql/bin/mysql
alias mysqladmin=/usr/local/mysql/bin/mysqladmin
mysql --version
/usr/local/mysql/bin/mysql Ver 8.0.19 for macos10.15 on x86_64 (MySQL Community Server - GPL)