macの再起動後に起こったエラー
自分でmysqlのバージョンを変えるコマンドを打ったことにより起こったエラー
この二つの合わせ技
なかなか解決に至る記事が見つからなかったのでここに書く
履歴を辿ってもその記事にたどり着けない不思議
理屈も何もないコマンドと結果のみ
$ chown username /usr/local/var/mysql/***.local.err
おそらくこのコマンドの後に
$ mysql.server start
で、直った。以下は軌跡
ERROR! The server quit without updating PID file
$ mysql.server start
Starting MySQL
.Logging to '/usr/local/var/mysql/***.local.err'.
ERROR! The server quit without updating PID file (/usr/local/var/mysql/***.local.pid).
$ mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
$ touch /tmp/mysql.sock
$ mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (38)
$ mysql.server start
Starting MySQL
.Logging to '/usr/local/var/mysql/***.local.err'.
ERROR! The server quit without updating PID file (/usr/local/var/mysql/***.local.pid).
$ bundle exec rails s
can't connect to local mysql server through socket '/tmp/mysql.sock' (38)
Gem::Ext::BuildError: ERROR: Failed to build gem native extension
$ bundle exec gem uninstall mysql2
Successfully uninstalled mysql2-0.5.2
$ bundle install
Installing mysql2 0.5.2 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
$ chown username /usr/local/var/mysql/***.local.err
$ chown username /usr/local/var/mysql/***.local.err
$ bundle install
installing mysql2 0.5.2 with native extensions
Bundle complete! 23 Gemfile dependencies, 81 gems now installed.
Bundled gems are installed into `./vender/bundle`
bundle install成功
can't connect to local mysql server through socket '/tmp/mysql.sock' (38)
$ bundle exec rails s
Mysql2::Error::ConnectionError (Can't connect to local MySQL server through socket '/tmp/mysql.sock' (38)):
エラーは変わらない
$ touch /usr/local/var/mysql/***.local.pid
$ mysql.server restart
ERROR! MySQL server PID file could not be found!
Starting MySQL
. ERROR! The server quit without updating PID file (/usr/local/var/mysql/***.local.pid).
$ touch /usr/local/var/mysql/***.local.pid
$ sudo mysql.server restart
ERROR! MySQL server PID file could not be found!
Starting MySQL
. ERROR! The server quit without updating PID file (/usr/local/var/mysql/***.local.pid).
初めはmysql.server start
で、エラーが起こっていたのでリスタートにしていたが、スタートで成功
$ touch /usr/local/var/mysql/***.local.pid
$ mysql.server start
Starting MySQL
.. SUCCESS!
理解した都度に更新していきます。ご容赦あれ