개발
Install mysql on MAC OS.
cozynow
2018. 1. 16. 23:52
brew 를 통해서 설치하는 방법
Mysql install
- installed mysql with brew install mysql
brew update
brew install mysql
brew install mysql56
ran the commands brew suggested: (see note: below)
unset TMPDIR
mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
mysql_install_db --verbose --user=
whoami--basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
- Start mysql with mysql.server start command, to be able to log on it
Used the alternate security script:
/usr/local/Cellar/mysql/5.5.10/bin/mysql_secure_installation- Followed the launchctl section from the brew package script output such as,
#startlaunchctl load -w ~Library/LaunchAgents/homebrew.mxcl.mysql.plist
launchctl load -w /usr/local/opt/mysql/homebrew.mxcl.mysql.plist
#stoplaunchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
계정 생성
MySQL 5.7.6 and later:
ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';
MySQL 5.7.5 and earlier:
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyNewPass');
FLUSH PRIVILEGES;
4. PATH 추가
/usr/local/opt/mysql/bin
실행
mysql.server start
Mysql uninstall
Step-by-step:
brew remove mysql
brew cleanup --force
launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
rm ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
sudo rm -rf /usr/local/var/mysql