OSX Yosemite に MySQL5.5 をインストールする方法

More than 3 years have passed since last update.

デフォルトだと MySQL 5.6 が入るので、古い MySQL を入れる手順

brew uninstall mysql

brew tap homebrew/versions
brew install mysql55
ln -sfv /usr/local/opt/mysql55/homebrew.mxcl.mysql55.plist ~/Library/LaunchAgents
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql55.plist
export PATH=$PATH:/usr/local/opt/mysql55/bin
mysql.server start

cp /usr/local/opt/mysql55/mysql-test/include/default_my.cnf /etc/my.cnf


my.cnf

!include default_mysqld.cnf

!include default_client.cnf

[mysqld.1]
# Run the master.sh script before starting this process
#!run-master-sh

log-bin= master-bin

# Run tests with the performance schema instrumentation
loose-enable-performance-schema

[mysqlbinlog]
disable-force-if-open

[ENV]
MASTER_MYPORT= @mysqld.1.port
MASTER_MYSOCK= @mysqld.1.socket

[mysqld]
bind-address = 192.168.21.199
#datadir=/var/lib/mysql
#socket=/var/lib/mysql/mysql.sock
skip-name-resolve
default-storage-engine = InnoDB
character-set-server = utf8
skip-character-set-client-handshake

# log
log-error=/var/log/mysql/error.log
log-warnings=1
#general_log = 1
#general_log_file = /var/log/mysql/mysql.log
#slow_query_log = 1
#slow_query_log_file = /var/log/mysql/slow.log
long-query-time=10
log-queries-not-using-indexes

# max connections
max_connections = 256
thread_cache_size = 8

# global buffer
key_buffer_size = 512M
max_allowed_packet = 16M
table_open_cache = 512
tmp_table_size = 64M
max_heap_table_size = 64M
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
query_cache_type = 1
query_cache_size = 32M
query_cache_limit = 4M

# InnoDB
innodb_buffer_pool_size = 512M
innodb_additional_mem_pool_size = 20M
innodb_log_buffer_size = 32M
innodb_file_per_table
innodb_log_file_size = 128M
innodb_flush_log_at_trx_commit = 0

# replicate
#log-bin=mysql-bin
#expire_logs_days = 3
#server-id = 1

[mysqld_safe]
pid-file=/var/run/mysqld/mysqld.pid
character-set-server = utf8

[mysqldump]
quick
max_allowed_packet = 16M
default-character-set = utf8

[mysql]
default-character-set = utf8

[myisamchk]
key_buffer_size = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M