homebrewでMySQLをインストールすることはできましたが、サーバ起動でエラーになります。MBPのLion(MacOS10.7.4)です。
$ mysql.server start
Starting MySQL
......... ERROR! The server quit without updating PID file (/usr/local/var/mysql/hogehoge.pid).
その前に unknown variable 'mysql.default_socket=/tmp/mysql.sock'
エラーも出てます。
$ mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
Installing MySQL system tables...
120824 14:31:55 [ERROR] /usr/local/Cellar/mysql/5.5.25a/bin/mysqld: unknown variable 'mysql.default_socket=/tmp/mysql.sock'
120824 14:31:55 [ERROR] Aborting
120824 14:31:55 [Note] /usr/local/Cellar/mysql/5.5.25a/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/Cellar/mysql/5.5.25a/bin/mysqld --skip-grant &
and use the command line tool /usr/local/Cellar/mysql/5.5.25a/bin/mysql
to connect to the mysql database and look at the grant tables:
shell> /usr/local/Cellar/mysql/5.5.25a/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/Cellar/mysql/5.5.25a/scripts/mysqlbug script!
なお /usr/local/Cellar/mysql/5.5.25a/bin/mysqld --skip-grant & の結果は次のように
unknown variable 'mysql.default_socket=/tmp/mysql.sock'となります。
$ /usr/local/Cellar/mysql/5.5.25a/bin/mysqld --skip-grant &
[1] 6762
16:18:03 ~/todo $ 120824 16:18:03 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive
120824 16:18:03 InnoDB: The InnoDB memory heap is disabled
120824 16:18:03 InnoDB: Mutexes and rw_locks use GCC atomic builtins
120824 16:18:03 InnoDB: Compressed tables use zlib 1.2.5
120824 16:18:03 InnoDB: Initializing buffer pool, size = 128.0M
120824 16:18:03 InnoDB: Completed initialization of buffer pool
120824 16:18:03 InnoDB: highest supported file format is Barracuda.
120824 16:18:03 InnoDB: Waiting for the background threads to start
120824 16:18:04 InnoDB: 1.1.8 started; log sequence number 1595675
120824 16:18:04 [ERROR] /usr/local/Cellar/mysql/5.5.25a/bin/mysqld: unknown variable 'mysql.default_socket=/tmp/mysql.sock'
120824 16:18:04 [ERROR] Aborting
120824 16:18:04 InnoDB: Starting shutdown...
120824 16:18:05 InnoDB: Shutdown completed; log sequence number 1595675
120824 16:18:05 [Note] /usr/local/Cellar/mysql/5.5.25a/bin/mysqld: Shutdown complete
また以前に中途半端にdmgでインストールしようとした事はありました。
システム環境設定に「MySQL」が残っていて /usr/local/mysql/bin/mysqladminを呼んでいたので
$ cd /usr/local
$ ln -s /usr/local/Cellar/mysql/5.5.25a mysql
でリンクを作って、「Start MySQL Server」ボタンを押せるようにして押しても
The MySQL Server Instance is stopped
のままびくともしません。
エラーログまわりの設定が必要なのかもしれませんが、Lionでのエラーログの正しい場所が
Linuxでの/var/log/mysql/error.log とは違うのだろうなとは思いつつ良く解っていません。
ご教示のほどよろしくお願い致します。
tmtmsさんのご指摘で再トライの結果
$ /usr/local/Cellar/mysql/5.5.25a/bin/mysqld --skip-grant &
[1] 12595
$ 120824 18:11:30 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive
120824 18:11:30 InnoDB: The InnoDB memory heap is disabled
120824 18:11:30 InnoDB: Mutexes and rw_locks use GCC atomic builtins
120824 18:11:30 InnoDB: Compressed tables use zlib 1.2.5
120824 18:11:30 InnoDB: Initializing buffer pool, size = 128.0M
120824 18:11:30 InnoDB: Completed initialization of buffer pool
120824 18:11:30 InnoDB: highest supported file format is Barracuda.
120824 18:11:30 InnoDB: Waiting for the background threads to start
120824 18:11:31 InnoDB: 1.1.8 started; log sequence number 1595675
120824 18:11:31 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
120824 18:11:31 [Note] - '0.0.0.0' resolves to '0.0.0.0';
120824 18:11:31 [Note] Server socket created on IP: '0.0.0.0'.
120824 18:11:31 [Warning] Can't open and lock time zone table: Table 'mysql.time_zone_leap_second' doesn't exist trying to live without them
120824 18:11:31 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
120824 18:11:31 [ERROR] Native table 'performance_schema'.'events_waits_current' has the wrong structure
120824 18:11:31 [ERROR] Native table 'performance_schema'.'events_waits_history' has the wrong structure
120824 18:11:31 [ERROR] Native table 'performance_schema'.'events_waits_history_long' has the wrong structure
120824 18:11:31 [ERROR] Native table 'performance_schema'.'setup_consumers' has the wrong structure
120824 18:11:31 [ERROR] Native table 'performance_schema'.'setup_instruments' has the wrong structure
120824 18:11:31 [ERROR] Native table 'performance_schema'.'setup_timers' has the wrong structure
120824 18:11:31 [ERROR] Native table 'performance_schema'.'performance_timers' has the wrong structure
120824 18:11:31 [ERROR] Native table 'performance_schema'.'threads' has the wrong structure
120824 18:11:31 [ERROR] Native table 'performance_schema'.'events_waits_summary_by_thread_by_event_name' has the wrong structure
120824 18:11:31 [ERROR] Native table 'performance_schema'.'events_waits_summary_by_instance' has the wrong structure
120824 18:11:31 [ERROR] Native table 'performance_schema'.'events_waits_summary_global_by_event_name' has the wrong structure
120824 18:11:31 [ERROR] Native table 'performance_schema'.'file_summary_by_event_name' has the wrong structure
120824 18:11:31 [ERROR] Native table 'performance_schema'.'file_summary_by_instance' has the wrong structure
120824 18:11:31 [ERROR] Native table 'performance_schema'.'mutex_instances' has the wrong structure
120824 18:11:31 [ERROR] Native table 'performance_schema'.'rwlock_instances' has the wrong structure
120824 18:11:31 [ERROR] Native table 'performance_schema'.'cond_instances' has the wrong structure
120824 18:11:31 [ERROR] Native table 'performance_schema'.'file_instances' has the wrong structure
120824 18:11:31 [Note] /usr/local/Cellar/mysql/5.5.25a/bin/mysqld: ready for connections.
Version: '5.5.25a' socket: '/tmp/mysql.sock' port: 3306 Source distribution
$ /usr/local/Cellar/mysql/5.5.25a/bin/mysql -u root mysql
/usr/local/Cellar/mysql/5.5.25a/bin/mysql: unknown variable 'mysql.default_socket=/tmp/mysql.sock'
【追記】brew info mysql の結果
$ brew info mysql
mysql: stable 5.5.25a (bottled)
http://dev.mysql.com/doc/refman/5.5/en/
Depends on: cmake, pidof
Conflicts with: percona-server, mariadb
/usr/local/Cellar/mysql/5.5.25a (6382 files, 222M) *
https://github.com/mxcl/homebrew/commits/master/Library/Formula/mysql.rb
==> Options
--with-tests
Build with unit tests
--universal
Build a universal binary
--with-archive-storage-engine
Compile with the ARCHIVE storage engine enabled
--with-embedded
Build the embedded server
--with-blackhole-storage-engine
Compile with the BLACKHOLE storage engine enabled
--with-libedit
Compile with editline wrapper instead of readline
--enable-local-infile
Build with local infile loading support
==> Caveats
Set up databases to run AS YOUR USER ACCOUNT with:
unset TMPDIR
mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
To set up base tables in another folder, or use a different user to run
mysqld, view the help for mysqld_install_db:
mysql_install_db --help
and view the MySQL documentation:
* http://dev.mysql.com/doc/refman/5.5/en/mysql-install-db.html
* http://dev.mysql.com/doc/refman/5.5/en/default-privileges.html
To run as, for instance, user "mysql", you may need to `sudo`:
sudo mysql_install_db ...options...
Start mysqld manually with:
mysql.server start
Note: if this fails, you probably forgot to run the first two steps up above
A "/etc/my.cnf" from another install may interfere with a Homebrew-built
server starting up correctly.
To connect:
mysql -uroot
To launch on startup:
* if this is your first install:
mkdir -p ~/Library/LaunchAgents
cp /usr/local/Cellar/mysql/5.5.25a/homebrew.mxcl.mysql.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
* if this is an upgrade and you already have the homebrew.mxcl.mysql.plist loaded:
launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
cp /usr/local/Cellar/mysql/5.5.25a/homebrew.mxcl.mysql.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
You may also need to edit the plist to use the correct "UserName".
【参考】
http://tukaikta.blog135.fc2.com/blog-entry-197.html
http://dev.classmethod.jp/etc/macbookair-homebrew-mysql5-5-14/