MAMP PRO, MySQLをアップグレード

時々起動に失敗する我が家のMAMP PROのMySQL。
停止して開始にしたら起動したりするのでそのまま使ってたけど、気持ち悪いのでログを見ることにしました。

出てる出てる。
[ERROR]の文字がたくさん…

please run mysql_upgrade to create it
らしいのでアップグレードすることに。

MAMP PROはエライ。
ちゃーんとメニューを用意してくれていました。

ツール -> MYSQL データベースをアップグレード

データーベースをバックアップしましょうねの警告つきです。
DBをさわる時は手を抜かずにダンプしておきましょう。

[ERROR] Missing system table mysql.proxies_priv; please run mysql_upgrade to create it
[ERROR] Native table 'performance_schema'.'events_waits_current' has the wrong structure
[ERROR] Native table 'performance_schema'.'events_waits_history' has the wrong structure
[ERROR] Native table 'performance_schema'.'events_waits_history_long' has the wrong structure
[ERROR] Native table 'performance_schema'.'setup_consumers' has the wrong structure
[ERROR] Native table 'performance_schema'.'setup_instruments' has the wrong structure
[ERROR] Native table 'performance_schema'.'setup_timers' has the wrong structure
[ERROR] Native table 'performance_schema'.'performance_timers' has the wrong structure
[ERROR] Native table 'performance_schema'.'threads' has the wrong structure
[ERROR] Native table 'performance_schema'.'events_waits_summary_by_thread_by_event_name' has the wrong structure
[ERROR] Native table 'performance_schema'.'events_waits_summary_by_instance' has the wrong structure
[ERROR] Native table 'performance_schema'.'events_waits_summary_global_by_event_name' has the wrong structure
[ERROR] Native table 'performance_schema'.'file_summary_by_event_name' has the wrong structure
[ERROR] Native table 'performance_schema'.'file_summary_by_instance' has the wrong structure
[ERROR] Native table 'performance_schema'.'mutex_instances' has the wrong structure
[ERROR] Native table 'performance_schema'.'rwlock_instances' has the wrong structure
[ERROR] Native table 'performance_schema'.'cond_instances' has the wrong structure
[ERROR] Native table 'performance_schema'.'file_instances' has the wrong structure

MAMP, MySQLの起動エラーに対処

MAMPのMySQLが突然起動しなくなった。

mysql_error_log.err を見るとInnoDBが起動できないのが原因の様子。

[ERROR] Plugin 'InnoDB' init function returned error.
[ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
[ERROR] Unknown/unsupported storage engine: InnoDB
[ERROR] Aborting

dbフォルダにあったlib_logfile0とlib_logfile1を捨ててたら起動できた。
なんでかな。

MAMP, アップグレードのためのメモ

MAMPはダウンロードしたMAMPフォルダを単純にアプリケーションフォルダへコピーするだけでインストールが完了します。
そのため、旧ファイルはすべて上書きになるので以前のデータ、特にデータベースをバックアプしないと悲しいことが起きます。

DBデータのバックアップも単純な上書きコピーで行えるので、ダンプを取ってRestoreなどの手順はいりません。

旧MAMPフォルダのdbフォルダをフォルダごとバックアップします。
デスクトップなどへ移動すればいいでしょう。

新MAMPをダウンロードしアプリケーションへコピーします。
「置き換える」と警告がでてもそのまま続けて構いません。

コピー後にMAMPフォルダへバックアップしたdbフォルダをコピーします。
これも置き換えてください。

MAMPを起動すると「データベースをアップデート」する旨のメッセージがでます。

これで、旧DBデータを引き継いだMAMPアップグレードが完了です。

*この手順は自分のメモのために書いたものです。データを保証するものではありません。トラブルが発生しても保証はできません。作業される場合はオウン・リスクでお願いします。

update
MAMP ヘルプファイルに同じことが書いてありました。

Procedure 1 MAMP update
1. Rename the current program folder MAMP to MAMP_OLD
2. Load the installation image of MAMP from http://mamp.info and open it
3. Drag the MAMP folder from the installation image to your “Applications“ folder
4. Copy the directories “htdocs” and “db “ from your MAMP_OLD folder into the
MAMP folder. It contains your personal HTML files and database contents.
Overwrite the folders in the new MAMP folder
5. Check whether all data has been transferred correctly
6. The MAMP_OLD folder can now be deleted. You may however keep it, so you can
fall back to your original setup

Apacheのdocument folderを htdocs にしている時はこれも上書きコピーね。

MAMPをアップグレードする時 PEAR ライブラリもバックアップとるといいよ

MAMP+PerlでMovableTypeをインストールするためにゴニョゴニョしました

MAMP で MovableType をインストールには Perl 環境をセットアップしないとダメ。

MAMP で Perl を使おうとすると超面倒くさい。
まず GD, ImageMagic 環境をつくるのが1回でできた試しがない。
Perl の DBI ドライバ DBD::mysql のインストールが毎回苦労する。

今までに4台はセットアップしてきたけどそのつど記録も取らず次にいかせてない。
今回アップデートされたばかりの OS X 10.5.7 へセットアップしたので覚えている限りのことをメモしとく。
残念ながら今回も記録はない、記憶していることだけ・・・
“MAMP+PerlでMovableTypeをインストールするためにゴニョゴニョしました” の続きを読む