1. 程式人生 > >Macos下安裝MySQL簡明教程

Macos下安裝MySQL簡明教程

環境介紹

Macos Jave 10.14. MySQL 5.7

基於Brew安裝

brew install [email protected]

執行結果如下:

Updating Homebrew...
==> Downloading https://homebrew.bintray.com/bottles/[email protected]
######################################################################## 100.0%
==> Pouring [email protected]
==> /usr/local/Cellar/
[email protected]
/5.7.24/bin/mysqld --initialize-insecure --user=chenjunfeng1 --basedir=/usr/local/Cellar/[email protected]/5.7.24 --datadir=/usr/local/var/mysql --tmpdir=/tmp ==> 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 -uroot
[email protected]
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 [email protected] first in your PATH run: echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.bash_profile For compilers to find
[email protected]
you may need to set: export LDFLAGS="-L/usr/local/opt/[email protected]/lib" export CPPFLAGS="-I/usr/local/opt/[email protected]/include" For pkg-config to find [email protected] you may need to set: export PKG_CONFIG_PATH="/usr/local/opt/[email protected]/lib/pkgconfig" To have launchd start [email protected] now and restart at login: brew services start [email protected] Or, if you don't want/need a background service you can just run: /usr/local/opt/[email protected]/bin/mysql.server start ==> Summary