LoginSignup
0
0

More than 3 years have passed since last update.

【MySQL】起動の仕方

Last updated at Posted at 2020-01-24

状況

MySQLが起動できない。
データベースの中身を全部消しても問題ない。
失敗1~3 => 成功 の順番で実行した。

成功

参考
mysqlがどうしても起動しない

実行コマンド
sudo rm -rf /usr/local/var/mysql
brew uninstall mysql
brew install mysql
sudo mysql.server start

Starting MySQL
. SUCCESS!

mysql -u root

Welcome to the MySQL monitor.  

もしくは
The server quit without updating PID file mysqlエラー解決方法

失敗1

参考
MySQLクライアントに Can't read dir of '/usr/local/etc/my.cnf.d' と言われた。

実行コマンド
mkdir my.cnf.d

エラー

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

失敗2

参考
mysqlが起動できない

実行コマンド
sudo touch /tmp/mysql.sock
sudo chown mysql:mysql /tmp
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/MBP-3.local.pid).

失敗3

参考
MySQL起動できなくなった The server quit without updating PID file

実行コマンド
touch MBP-3.local.pid

エラー

なぜか作っても消えてしまう。。。

ERROR! MySQL server PID file could not be found!
Starting MySQL
. ERROR! The server quit without updating PID file (/usr/local/var/mysql/MBP-3.local.pid).
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0