Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save azurestone/6044314 to your computer and use it in GitHub Desktop.

Select an option

Save azurestone/6044314 to your computer and use it in GitHub Desktop.
mkdir -p ${HOME}/Data/mysql-5.6.10
mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=${HOME}Data/mysql-5.6.10 --tmpdir=/tmp
cd /usr/local/opt/mysql
# datadir = のパスを追記する
vim
# パスワードを設定する
mysqladmin -u root password "パスワード"
# 起動スクリプトの配置
ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents
# 起動スクリプトの読み込み
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
# MySQL 起動
mysql.server start
# ログイン権限の初期化
mysql_secure_installation
@azurestone
Copy link
Author

自動起動をオフにする

vim Library/LaunchAgents/homebrew.mxcl.mysql.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>KeepAlive</key>
  <true/>
  <key>Label</key>
  <string>homebrew.mxcl.mysql</string>
  <key>ProgramArguments</key>
  <array>
    <string>/usr/local/opt/mysql/bin/mysqld_safe</string>
    <string>--bind-address=127.0.0.1</string>
  </array>
  <key>RunAtLoad</key>
  <true/>
  <key>WorkingDirectory</key>
  <string>/usr/local/var</string>
</dict>
</plist>
  • trueをfalseにする。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment