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

MySQLクックブック〈VOLUME1〉〈VOLUME2〉

MySQLクックブック〈VOLUME1〉
ポール デュボワ

¥5,670

MySQLクックブック〈VOLUME2〉
ポール デュボワ

¥4,620

必読:MySQL使いになるために

2冊で1万円を超えてしまいます。
2003年の出版なので、MySQL4.0系の話が多くなり副選択などは軽く触れられているだけです。
それでもこの本の価値は燦然と輝いていると思います。

オライリーの「クックブック」いっつもボリューム満点ですが、この本も例外ではありません。
複数の翻訳者による本ですが、文章は整然として章ごとにバラバラ感は無く読みやすいと感じました。

〈VOLUME2〉の「第12章 複数テーブルの使用」は何度も読み返しました。
また、同じく〈VOLUME2〉の「第13章 統計手法」もなるほどネな話が多くためになりました。

PHP, Perl, Python, JAVA などの言語からの操作方法も全てではないですが例示されていたりする点も参考になります。

CMSなどのツールを使うと直接SQLを書くことはほとんどないですが、使えると便利度は飛躍的に上がります。

また、CMSやフレームワークを使わないWebアプリ開発にはSQLは必須です。
ホスティングサーバーが提供するDBのほとんどがMySQLな現状を考えると、手元に置いておきたい2冊だと思います。

WordPressを初めとするCMSもほとんどがMySQLを前提として提供されてるし、やっぱり「読め」です。

ページ数も多く内容も濃いので1冊ずつ読むといいのかもです。