brew updateしようとしたら以下の様なエラーが発生しました。
$ brew update
error: unable to unlink old 'bin/brew' (Permission denied)
Error: Failure while executing: git pull --ff --no-rebase --quiet origin refs/heads/master:refs/remotes/origin/master
https://github.com/Homebrew/homebrew/issues/3247#issuecomment-548941 を参考にして権限を変更してから実行したら、またエラーが発生してしまいました。
$ brew update
...
...
...
Could not restore untracked files from stash
Error: Failure while executing: git stash pop --quiet
今度はbrew doctorしてみました。そこで出てた警告を解決してみます。
Warning: Xcode 7 lacks the 10.10 SDK which can cause some builds to fail.
We recommend installing the Command Line Tools with:
xcode-select --install
to resolve this issue.
こちらを実行してみたら、なぜかxcodeのcommand line toolsがないからインストールしてくださいと言われたのでインストールしました。
それから再度brew updateしてみたら問題なく正常終了しました。
原因は何かの拍子にxcodeのcommand line toolsがアンインストールされてしまったことだったようです。
達人に学ぶDB設計 徹底指南書 初級者で終わりたくないあなたへの演習問題にあったので調べてみました。
mysql> SELECT version();
+-----------+
| version() |
+-----------+
| 5.6.26 |
+-----------+
もしくは、
mysql> SHOW VARIABLES LIKE 'version%';
+-------------------------+----------+
| Variable_name | Value |
+-------------------------+----------+
| version | 5.6.26 |
| version_comment | Homebrew |
| version_compile_machine | x86_64 |
| version_compile_os | osx10.10 |
+-------------------------+----------+
4 rows in set (0.00 sec)
でもいいです。
$ mysql -v
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 54
Server version: 5.6.26 Homebrew
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Reading history-file /Users/kotamiyake/.mysql_history
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
だとMySQL tool/クライアントツールのバージョンを確認することになると書かれた記事があったのですが、普通にServer versionと書かれてますね。
オープンソースで使われているのはCommunity Editionで、現在(2015/11/4時点)の最新バージョンは5.7.9です。
ドキュメントはMySQL :: MySQL Documentationにあります。