Oracle's macOS build is a DMG with a native package (mysql-9.7.2-macos15-arm64.dmg; 9.7 is supported on macOS 14 and 15 on Apple silicon). It asks for a root password, installs into a versioned folder behind a /usr/local/mysql symlink, and registers the launch daemon com.oracle.oss.mysql.mysqld.plist, whose arguments override my.cnf.
Homebrew 6,457 's mysql formula is the 26.7.0 Innovation release, so ask for mysql@9.7 (9.7.2). It is keg-only, not linked into Homebrew's bin. These commands follow the formula's notes and were not run on this Linux machine:
brew install mysql@9.7
echo 'export PATH="$(brew --prefix mysql@9.7)/bin:$PATH"' >> ~/.zshrc
brew services start mysql@9.7 # launchd agent, restarts at login
mysql_secure_installation # root starts with no passwordIt listens on localhost only, and root has no password until you secure it. Coming from a formula older than 8.4, run 8.4 once first (Release Model).
XAMPP 2,521 , where many PHP tutorials still start, is the wrong choice here. Its newest release, 8.2.12 of November 2023, ships MariaDB 10.4.32 3,681 , not MySQL 524 , and MariaDB 10.4 reached end of life on 18 June 2024 (XAMPP). For one Windows installer with MySQL 9.7.2 LTS, use WampServer 861,070 (WampServer), or run the server in Docker 514 (Running MySQL in Docker).