Skip to content

Instantly share code, notes, and snippets.

@fumikito
Created January 30, 2024 23:55
Show Gist options
  • Save fumikito/ec209b440ebfb8c639138bbf3caf0afc to your computer and use it in GitHub Desktop.
Save fumikito/ec209b440ebfb8c639138bbf3caf0afc to your computer and use it in GitHub Desktop.
Update MySQL 5.6 to 5.7 on Macports / MacportsでMySQL5.6から5.7にアップデートする
# Update Macports / Macportsを最新に
sudo port selfupdate
# Stop MySQL 5.6 / MySQL 5.6を停止
sudo port unload mysql56-server
# Remove from service. / 自動起動から削除
sudo lauchctl unload -w /Library/LaunchDaemons/org.macports.mysql56-server.plist
# Install MySQL 5.7 / MySQL 5.7をインストール
sudo port install mysql57-server
# Copy my.cnf from old one. / 古いmy.cnfをコピー
sudo cp /opt/local/etc/mysql56/my.cnf /opt/local/etc/mysql57/my.cnf
# Start MYSQL 5.7 / MySQL 5.7を起動
sudo port load mysql57-server
# Check if MySQL works. / 動作確認
ps aux | grep mysql
_mysql 20655 0.0 0.0 409496128 14448 ?? Ss 5:20PM 0:00.62 /opt/local/lib/mysql57/bin/mysqld
# If server doesn't work,
# 1. my.cnf is OK? Check mysql log(log-error=) and see the messages.
# 動いていなかったら、
# 1. my.cnfがオーケーかログを見てチェック。
sudo vim /opt/local/etc/mysql57/my.cnf
# 2. Check the permission of Related folders. User name is "_mysql"
# 2. 関連フォルダの権限をチェック。ユーザーは "_mysql"
sudo chown -R _mysql:_mysql /opt/local/var/run/mysql57
# If server works, run upgrade script.
# サーバーが動いていたら、アップグレードスクリプトを実行
mysql_upgrade -u root -p
# If you find error log like below,
# try to change table_open_cache in my.cnf
# see: https://blog.shibayu36.org/entry/2022/12/13/115054
# 次のようなエラーが出たら、
# my.cnf の table_open_cache を変更してみてください。
# 参考: https://blog.shibayu36.org/entry/2022/12/13/115054
[Warning] File Descriptor 1694 exceeded FD_SETSIZE=1024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment