Eu configurei um servidor MySQL 5.6.17 no meu Mac OSX 10.9 para executar alguma demo (eu normalmente não tento coisas do MySQL e do Apache em um Mac), usando o Homebrew.
Tudo correu bem (além das partes fedorentas sobre o arquivo mysql.sock não estar no lugar certo)
MAS: Quando eu começo minha máquina, ela deve estar funcionando. No entanto, a maioria (se não todos) do tempo, não é. Quando eu vou para sudo /usr/local/bin/mysql.server start
, eu entendo isso:
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).
Eu posso fazer isso repetidamente, nada acontece.
Mas descobri algo ainda mais interessante: se eu cd /usr/local/Cellar/mysql/5.6.17/bin
e eu excluirmos repetidamente o arquivo de erro e tentarmos sudo mysql.server start
, ele eventualmente funcionará.
Aqui está um log que obtive enquanto escrevia esta mensagem:
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!
Eu com certeza sou um novato na administração do MySQL, ainda mais no Mac OSX. Mas eu também sou um programador veterano, e mal consigo entender por que um software como o MySQL pode exibir um comportamento imprevisível na inicialização. Eu entendo que algumas coisas podem ficar não-determinantes ao executar multithreaded soft às vezes, mas iniciando um servidor de dados, eu não sei ...
Alguma idéia do que pode estar acontecendo?
Aqui está o log de erros:
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