LoginSignup
23
30

More than 5 years have passed since last update.

Homebrewで入れたMySQLのmy-xxx.cnfの場所とmy.cnfの設置

Posted at

まずMySQLのインストール

$ brew install mysql

起動

$ mysql.server start

停止

$ mysql.server stop

ステータス確認

$ mysql.server status

my-xxx.cnfの場所

Homebrewで入れたアプリケーションは /usr/local/Cellar/ 以下に入るので /usr/local/Cellar/mysqlというディレクトリができているはず。

$ find /usr/local/Cellar/mysql -name "my*.cnf"
/usr/local/Cellar//mysql/5.7.17/support-files/my-default.cnf

my.cnfの設置

先程見つけたmy-xxx.cnfをmy.cnfにリネームしつつ設置する。
my.cnfの設置場所は以下で確認できる。
※4箇所出力されているが、左から順に読み込まれる。

[masatomo@Masatomo-no-MBP ~]$ mysql --help | grep my.cnf
                      order of preference, my.cnf, $MYSQL_TCP_PORT,
/etc/my.cnf /etc/mysql/my.cnf /usr/local/etc/my.cnf ~/.my.cnf

上記4箇所のいずれかにコピー&リネームして内容を適宜変更、リロードすればOK

$ mysql.server reload

23
30
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
23
30