Homebrewでインストールしたmysqlのmysql_install_dbが失敗する
brew install mysql
はうまくいっていて、その後のmysql_install_dbで失敗してしまう。
mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
を実行すると・・
Installing MySQL system tables... 131106 21:00:15 [ERROR] /usr/local/opt/mysql/bin/mysqld: Incorrect information in file: './mysql/tables_priv.frm' ERROR: 1033 Incorrect information in file: './mysql/tables_priv.frm' 131106 21:00:15 [ERROR] Aborting 131106 21:00:15 [Note] /usr/local/opt/mysql/bin/mysqld: Shutdown complete Installation of system tables failed! Examine the logs in /usr/local/var/mysql for more information. You can try to start the mysqld daemon with: shell> /usr/local/opt/mysql/bin/mysqld --skip-grant & and use the command line tool /usr/local/opt/mysql/bin/mysql to connect to the mysql database and look at the grant tables: shell> /usr/local/opt/mysql/bin/mysql -u root mysql mysql> show tables Try 'mysqld --help' if you have problems with paths. Using --log gives you a log in /usr/local/var/mysql that may be helpful. Please consult the MySQL manual section 'Problems running mysql_install_db', and the manual section that describes problems on your OS. Another information source are the MySQL email archives available at http://lists.mysql.com/. Please check all of the above before mailing us! And remember, if you do mail us, you MUST use the /usr/local/opt/mysql/scripts/mysqlbug script!
原因は何度かbrew install mysql
やbrew install mysql55
を実行していたので、
/usr/local/var
ディレクトリに不必要なファイルが残っていたからのようだ。
sudo rm -rf /usr/local/var/mysql*
を実行してから再度mysql_install_db
を実行することで無事インストールができました。
[24時間365日] サーバ/インフラを支える技術 ?スケーラビリティ、ハイパフォーマンス、省力運用 (WEB+DB PRESS plusシリーズ)
- 作者: 安井真伸,横川和哉,ひろせまさあき,伊藤直也,田中慎司,勝見祐己
- 出版社/メーカー: 技術評論社
- 発売日: 2008/08/07
- メディア: 単行本(ソフトカバー)
- 購入: 133人 クリック: 2,270回
- この商品を含むブログ (284件) を見る