LoginSignup
2
1

More than 5 years have passed since last update.

homebrewでインストールしたmysqlを自動起動できない→できた

Last updated at Posted at 2017-03-17
$ brew tap homebrew/services

homebrew-servicesインストールして、

$ brew services start mysql

ってやればええやん?

Error: Formula `mysql` is not installed.

あれ?

$ brew list | grep mysql
mysql55

ははーん、5.5だったのねめんごめんご

$ brew services start mysql55
Error: Formula `mysql@5.5` is not installed.

ぐっ・・・

$ brew services start mysql@5.5
Error: Formula `mysql@5.5` is not installed.

ぐぬぬぬ・・・mysqlを再インストールしてみよう

$ brew install mysql55
Warning: mysql55 already installed, it's just not migrated
You can migrate formula with `brew migrate mysql@5.5`
Or you can force install it with `brew install mysql@5.5 --force`

既にインストールされてますよ、と。
・・・んん?migrateしろ??

$ brew migrate mysql@5.5
==> Migrating mysql55 to mysql@5.5
==> Unlinking mysql55
Moving to: /usr/local/Cellar/mysql@5.5
==> Linking mysql@5.5

そいやっ

$ brew services start mysql@5.5
==> Successfully started `mysql@5.5` (label: homebrew.mxcl.mysql@5.5)

( ´∀`)bグッ!

ラベルがmysql55 → mysql@5.5 に変わったから、と理解しております

以上です

追記

登録自体はされるのですが、PC起動してもmysqlが自動起動してないようだ・・・
mysql の起動はroot権限でしかできないので、serviceへの登録もroot権限で行わないとだめみたいですね。
なので

$ sudo brew services start mysql@5.5

で( ´∀`)bグッ!

2
1
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
2
1