#
brew search mysql
#
brew install mysql@8.0
#
==> Installing mysql@8.0
==> Pouring mysql@8.0-8.0.36_1.sonoma.bottle.tar.gz
==> /usr/local/Cellar/mysql@8.0/8.0.36_1/bin/mysqld --initialize-insecure --user=cookie. --basedir=/usr/local/Cellar/mysql@8.0/8.0
==> Caveats
We've installed your MySQL database without a root password. To secure it run:
mysql_secure_installation
MySQL is configured to only allow connections from localhost by default
To connect run:
mysql -u root
mysql@8.0 is keg-only, which means it was not symlinked into /usr/local,
because this is an alternate version of another formula.
If you need to have mysql@8.0 first in your PATH, run:
echo 'export PATH="/usr/local/opt/mysql@8.0/bin:$PATH"' >> ~/.zshrc
For compilers to find mysql@8.0 you may need to set:
export LDFLAGS="-L/usr/local/opt/mysql@8.0/lib"
export CPPFLAGS="-I/usr/local/opt/mysql@8.0/include"
To start mysql@8.0 now and restart at login:
brew services start mysql@8.0
Or, if you don't want/need a background service you can just run:
/usr/local/opt/mysql@8.0/bin/mysqld_safe --datadir\=/usr/local/var/mysql
==> Summary
🍺 /usr/local/Cellar/mysql@8.0/8.0.36_1: 318 files, 301.2MB
==> Running `brew cleanup mysql@8.0`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
==> Caveats
==> mysql@8.0
We've installed your MySQL database without a root password. To secure it run:
mysql_secure_installation
MySQL is configured to only allow connections from localhost by default
To connect run:
mysql -u root
mysql@8.0 is keg-only, which means it was not symlinked into /usr/local,
because this is an alternate version of another formula.
If you need to have mysql@8.0 first in your PATH, run:
echo 'export PATH="/usr/local/opt/mysql@8.0/bin:$PATH"' >> ~/.zshrc
For compilers to find mysql@8.0 you may need to set:
export LDFLAGS="-L/usr/local/opt/mysql@8.0/lib"
export CPPFLAGS="-I/usr/local/opt/mysql@8.0/include"
To start mysql@8.0 now and restart at login:
brew services start mysql@8.0
Or, if you don't want/need a background service you can just run:
/usr/local/opt/mysql@8.0/bin/mysqld_safe --datadir\=/usr/local/var/mysql
#
#
ll /usr/local/Cellar/mysql@8.0/8.0.36_1/bin/mysqld
#
echo 'export PATH="/usr/local/opt/mysql@8.0/bin:$PATH"' >> ~/.zshrc
echo 'export LDFLAGS="-L/usr/local/opt/mysql@8.0/lib"' >> ~/.zshrc
echo 'export CPPFLAGS="-I/usr/local/opt/mysql@8.0/include"' >> ~/.zshrc
source ~/.zshrc
#
brew services start mysql@8.0
#
mysql_secure_installation
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· 三行代码完成国际化适配,妙~啊~
· .NET Core 中如何实现缓存的预热?
· 如何调用 DeepSeek 的自然语言处理 API 接口并集成到在线客服系统