Created
July 20, 2013 08:28
-
-
Save azurestone/6044314 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
Author
Author
設定を確認する
$ mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.10 Source distribution
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> status;
--------------
mysql Ver 14.14 Distrib 5.6.10, for osx10.8 (x86_64) using EditLine wrapper
Connection id: 1
Current database:
Current user: god@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 5.6.10 Source distribution
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: utf8
Db characterset: utf8
Client characterset: utf8
Conn. characterset: utf8
UNIX socket: /tmp/mysql.sock
Uptime: 18 sec
Threads: 1 Questions: 5 Slow queries: 0 Opens: 67 Flush tables: 1 Open tables: 60 Queries per second avg: 0.277
--------------
mysql>
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
vim /usr/local/var/mysql/my.cnf