ふわ

2021年04月04日に参加

学習履歴詳細

MySQLの再インストール

Mysqlが起動できない

いつものようにMysqlを起動しようとしましたが、できません。

$ mysql.server start
Starting MySQL
.. ERROR! The server quit without updating PID file (/usr/local/var/mysql/XXXXXXXX.local.pid).
$ mysql -u root -p
Can't connect to local MySQL server through socket '/tmp/mysql.sock'(2)

pidファイルの自作・chownでlocal以下のディレクトリの所有権を変更する、プロセスを終了させるなどを試したが、エラー内容が変わりませんでした。

最終的に、MySQLのデータを削除し、再インストールすることで解決しました。

# MySQLのデータファイルやログなどが格納されているディレクトリを削除する
$ sudo rm -rf /usr/local/var/mysql

# MySQLを再インストール
$ brew uninstall mysql
$ brew install mysql

# MySQLを起動
$ mysql.server start
Starting MySQL
 SUCCESS! 

時間がかかりすぎた…笑

参考:

https://reasonable-code.com/mysql-start-error/

https://qiita.com/_natsu_no_yuki_/items/ae4c94187093e4ab3cdc

https://qiita.com/carotene4035/items/e00076fe3990b9178cc0

https://stackoverflow.com/questions/4963171/mysql-server-startup-error-the-server-quit-without-updating-pid-file

https://stackoverflow.com/questions/15450091/for-a-newbie-error-2002-hy000-cant-connect-to-local-mysql-server-through-so

プロを目指す人のためのRuby入門

  • 2.8.3 ヒアドキュメンント
  • 2.8.4 フォーマットを指定した文字列
  • 2.8.5 文字列作成色々
  • 2.10.2 真偽値
  • 2.10.3 unless
  • 2.10.4 case
  • 2.10.5 Ternary operation(3項演算子)
    • StackOverflowでよく見かける
  • 2.11.1 argument with default value
  • 2.11.2 methods ends with "?"
  • 2.11.3 Methods end with ! (destructive method)

その他

Linux

2019年09月09日(月)

5.5時間