El CapitanでMySQLを5.7から5.5 にダウングレードしたら起動しなくなった
問題
最新のMySQL5.7をアンインストールして,MySQL5.5をインストールして, brew services start mysql55
したら, started
になってるけど, ps aux | grep mysql
しても動いてない.Console.app
でログを確認したら,起動して一瞬で死んでを繰り返していた.
/user/local/var/mysql55/$HOST.err
を見てたらこんな感じのエラー出てた.
160815 17:23:04 mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql55 160815 17:23:04 [Note] /usr/local/Cellar/mysql55/5.5.49/bin/mysqld (mysqld 5.5.49) starting as process 11713 ... 160815 17:23:04 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql55/ is case insensitive /usr/local/Cellar/mysql55/5.5.49/bin/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13) 160815 17:23:04 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it. 160815 17:23:04 InnoDB: The InnoDB memory heap is disabled 160815 17:23:04 InnoDB: Mutexes and rw_locks use GCC atomic builtins 160815 17:23:04 InnoDB: Compressed tables use zlib 1.2.5 160815 17:23:04 InnoDB: Initializing buffer pool, size = 128.0M 160815 17:23:04 InnoDB: Completed initialization of buffer pool 160815 17:23:04 InnoDB: Operating system error number 13 in a file operation. InnoDB: The error means mysqld does not have the access rights to InnoDB: the directory. InnoDB: File name ./ibdata1 InnoDB: File operation call: 'create'. InnoDB: Cannot continue operation.
TL;DR
my.conf をこんな感じでコピーして配置する.
$ cp /usr/local/opt/mysql55/support-files/my-small.cnf /usr/local/etc/my.cnf
それで,配置した my.conf
の mysqld
に user = 自分のユーザ名
を書いたら起動するようになった.
試したやつ
- マシンの再起動
- MySQL5.5再インストール
mysql services
ではなく,シンボリックリンクしてlaunchctl
でやる
(なんか色々やりすぎて,漏れてるやつあると思う...)