我在 OSX 10.9.2 上有一个 MySQL 5.6.17 服务器,它“有时可以启动”,但大多数时候都无法启动

我在 OSX 10.9.2 上有一个 MySQL 5.6.17 服务器,它“有时可以启动”,但大多数时候都无法启动

我已经在 Mac OSX 10.9 上设置了一个 MySQL 5.6.17 服务器来运行一些演示(我通常不会在 Mac 上尝试 MySQL 和 Apache),使用 Homebrew。

一切都很顺利(除了常见的 mysql.sock 文件不在正确位置的问题)

但是:当我启动我的机器时,它应该启动并运行。然而,大多数(如果不是全部)时间,它都不是。当我选择时sudo /usr/local/bin/mysql.server start,我得到了:

iMac-de-Mathieu:~ mathieubolla$ sudo /usr/local/bin/mysql.server start
Password:
Starting MySQL
. ERROR! The server quit without updating PID file (/usr/local/var/mysql/iMac-de-Mathieu.local.pid).

我可以反复这样做,但什么也没发生。

但我发现了更有趣的事情:如果我cd /usr/local/Cellar/mysql/5.6.17/bin和我反复删除错误文件并尝试sudo mysql.server start,它最终会起作用。

这是我撰写此消息时获得的日志:

iMac-de-Mathieu:bin mathieubolla$ sudo mysql.server
Usage: mysql.server  {start|stop|restart|reload|force-reload|status}  [ MySQL server options ]
iMac-de-Mathieu:bin mathieubolla$ sudo mysql.server start
Starting MySQL
. ERROR! The server quit without updating PID file (/usr/local/var/mysql/iMac-de-Mathieu.local.pid).
iMac-de-Mathieu:bin mathieubolla$ sudo rm /usr/local/var/mysql/iMac-de-Mathieu.local.err
iMac-de-Mathieu:bin mathieubolla$ sudo mysql.server start
Starting MySQL
. ERROR! The server quit without updating PID file (/usr/local/var/mysql/iMac-de-Mathieu.local.pid).
iMac-de-Mathieu:bin mathieubolla$ sudo rm /usr/local/var/mysql/iMac-de-Mathieu.local.err
iMac-de-Mathieu:bin mathieubolla$ sudo mysql.server start
Starting MySQL
. ERROR! The server quit without updating PID file (/usr/local/var/mysql/iMac-de-Mathieu.local.pid).
iMac-de-Mathieu:bin mathieubolla$ sudo rm /usr/local/var/mysql/iMac-de-Mathieu.local.err
iMac-de-Mathieu:bin mathieubolla$ sudo mysql.server start
Starting MySQL
. SUCCESS! 

我确实是一个 MySQL 管理新手,在 Mac OSX 上更是新手。但我也是一名资深程序员,我几乎不明白为什么像 MySQL 这样的软件在启动时会出现不可预测的行为。我知道在运行多线程软件时,有些事情可能会变得不确定,但启动数据服务器时,我不知道……

知道可能发生了什么事吗?

这是错误日志:

140507 10:20:50 mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql
2014-05-07 10:20:51 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation     for more details).
2014-05-07 10:20:51 11262 [Note] Plugin 'FEDERATED' is disabled.
/usr/local/Cellar/mysql/5.6.17/bin/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13 - Permission denied)
2014-05-07 10:20:51 11262 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
2014-05-07 10:20:51 11262 [Note] InnoDB: Using atomics to ref count buffer pool pages
2014-05-07 10:20:51 11262 [Note] InnoDB: The InnoDB memory heap is disabled
2014-05-07 10:20:51 11262 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2014-05-07 10:20:51 11262 [Note] InnoDB: Compressed tables use zlib 1.2.3
2014-05-07 10:20:51 11262 [Note] InnoDB: Using CPU crc32 instructions
2014-05-07 10:20:51 11262 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2014-05-07 10:20:51 11262 [Note] InnoDB: Completed initialization of buffer pool
2014-05-07 10:20:51 11262 [ERROR] InnoDB: ./ibdata1 can't be opened in read-write mode
2014-05-07 10:20:51 11262 [ERROR] InnoDB: The system tablespace must be writable!
2014-05-07 10:20:51 11262 [ERROR] Plugin 'InnoDB' init function returned error.
2014-05-07 10:20:51 11262 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2014-05-07 10:20:51 11262 [ERROR] Unknown/unsupported storage engine: InnoDB
2014-05-07 10:20:51 11262 [ERROR] Aborting

2014-05-07 10:20:51 11262 [Note] Binlog end
2014-05-07 10:20:51 11262 [Note] Shutting down plugin 'partition'
2014-05-07 10:20:51 11262 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2014-05-07 10:20:51 11262 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2014-05-07 10:20:51 11262 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2014-05-07 10:20:51 11262 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2014-05-07 10:20:51 11262 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2014-05-07 10:20:51 11262 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2014-05-07 10:20:51 11262 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2014-05-07 10:20:51 11262 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2014-05-07 10:20:51 11262 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2014-05-07 10:20:51 11262 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2014-05-07 10:20:51 11262 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2014-05-07 10:20:51 11262 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2014-05-07 10:20:51 11262 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2014-05-07 10:20:51 11262 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2014-05-07 10:20:51 11262 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2014-05-07 10:20:51 11262 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2014-05-07 10:20:51 11262 [Note] Shutting down plugin 'INNODB_METRICS'
2014-05-07 10:20:51 11262 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2014-05-07 10:20:51 11262 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2014-05-07 10:20:51 11262 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2014-05-07 10:20:51 11262 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2014-05-07 10:20:51 11262 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2014-05-07 10:20:51 11262 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2014-05-07 10:20:51 11262 [Note] Shutting down plugin 'INNODB_CMPMEM'
2014-05-07 10:20:51 11262 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2014-05-07 10:20:51 11262 [Note] Shutting down plugin 'INNODB_CMP'
2014-05-07 10:20:51 11262 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2014-05-07 10:20:51 11262 [Note] Shutting down plugin 'INNODB_LOCKS'
2014-05-07 10:20:51 11262 [Note] Shutting down plugin 'INNODB_TRX'
2014-05-07 10:20:51 11262 [Note] Shutting down plugin 'BLACKHOLE'
2014-05-07 10:20:51 11262 [Note] Shutting down plugin 'ARCHIVE'
2014-05-07 10:20:51 11262 [Note] Shutting down plugin 'MRG_MYISAM'
2014-05-07 10:20:51 11262 [Note] Shutting down plugin 'MyISAM'
2014-05-07 10:20:51 11262 [Note] Shutting down plugin 'MEMORY'
2014-05-07 10:20:51 11262 [Note] Shutting down plugin 'CSV'
2014-05-07 10:20:51 11262 [Note] Shutting down plugin 'sha256_password'
2014-05-07 10:20:51 11262 [Note] Shutting down plugin 'mysql_old_password'
2014-05-07 10:20:51 11262 [Note] Shutting down plugin 'mysql_native_password'
2014-05-07 10:20:51 11262 [Note] Shutting down plugin 'binlog'
2014-05-07 10:20:51 11262 [Note] /usr/local/Cellar/mysql/5.6.17/bin/mysqld: Shutdown complete

140507 10:20:51 mysqld_safe mysqld from pid file /usr/local/var/mysql/iMac-de-Mathieu.local.pid ended

相关内容