MENU

brew mysql

2022 年 01 月 14 日 • 阅读: 172 • 学习笔记

Install Mysql

brew install mysql@5.7

I only needed Mysql5.7 at here.

Enable MySQL security mechanism

mysql_secure_installation

can run:

/opt/homebrew/opt/mysql@5.7/bin/mysql_secure_installation

If you need to have mysql@5.7 first in your PATH, run:

echo 'export PATH="/opt/homebrew/opt/mysql@5.7/bin:$PATH"' >> ~/.zshrc

For compilers to find mysql@5.7 you may need to set:

export LDFLAGS="-L/opt/homebrew/opt/mysql@5.7/lib"
export CPPFLAGS="-I/opt/homebrew/opt/mysql@5.7/include"

If you don't want/need a background service you can just run:

/opt/homebrew/opt/mysql@5.7/bin/mysqld_safe --datadir=/opt/homebrew/var/mysql

To connect run:

mysql -u root -p
添加新评论

|十年之约

本网站由提供CDN加速/云储存服务