Posted at

mysqlが起動しなかった。

More than 3 years have passed since last update.


  • Mac OSX 10.8.5

  • Homebrew

  • MySQL (Homebrewでインストール)


背景

そろそろ2週間前から集録し始めたのでデータベースの勉強がてら、データの集録と演算を勉強しようと構築したが...、起動しないよ(´・ω・`)


処置前

$ mysql

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
# おっと、mysqlが起きていなかった。
$ sudo mysql.server start
Starting MySQL
.. ERROR! The server quit without updating PID file (/*******)


処置後

$ sudo chown -R _mysql:_mysql /usr/local/var/mysql

$ sudo mysql.server start
Starting MySQL
.... SUCCESS!

$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.11 Homebrew

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>