Mac El Capitan (10.11.6) here. I installed MySQL via homebrew (brew install mysql
, which installed 5.7.17
) and was able to get it started with defaults (absolutely zero configuration to my.cnf
). I was able to create a database with tables, populate them, etc.
I open ~/.my.cnf
and see that its empty, which makes sense seeing that I never added any special configs to it in the first place.
So I add (to this empty file):
[mysqld]
default-storage-engine = innodb
default-character-set=utf8
collation-server = utf8_unicode_ci
init-connect='SET NAMES utf8'
I then run mysql.server start
to start MySQL and:
mysql.server start
Starting MySQL
... ERROR! The server quit without updating PID file (/usr/local/var/mysql/MyUsername.local.pid).
If I clear (and make empty again) the contents of ~/.my.cnf
and restart MySQL, it starts up perfectly fine (no errors; I can query tables, etc.). But if I add those contents back in, I get the same error.
So clearly MySQL is checking ~/.my.cnf
for configs to load, and clearly there's something about that syntax it doesn't like. So I start a series of config/test cycles to see which property is the offender.
I change ~/.my.cnf
to:
[mysqld]
default-storage-engine = innodb
And restart. Same exact error.
I change ~/.my.cnf
to:
[mysqld]
default-character-set=utf8
And restart. Same exact error.
I change ~/.my.cnf
to:
[mysqld]
collation-server = utf8_unicode_ci
And restart. Same exact error.
I change ~/.my.cnf
to:
[mysqld]
init-connect='SET NAMES utf8'
And restart. Same exact error. Clearly something else is going on here. MySQL doesn't like it when I specify any configurations inside ~/.my.cnf
. What's going on here?!?
I tried following all the recommendations in this article but none of them worked. Definitely seems like a MacOS/MySQL issue.
If I open /usr/local/var/mysql/MyUser.local.err
I see:
2017-04-13T13:10:42.6NZ mysqld_safe Logging to '/usr/local/var/mysql/MyUser.local.err'.
2017-04-13T13:10:42.6NZ mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql
2017-04-13T13:10:42.365982Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-04-13T13:10:42.366238Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled
2017-04-13T13:10:42.366286Z 0 [Note] /usr/local/Cellar/mysql/5.7.17/bin/mysqld (mysqld 5.7.17) starting as process 56561 ...
2017-04-13T13:10:42.369426Z 0 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive
2017-04-13T13:10:42.371041Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-04-13T13:10:42.371058Z 0 [Note] InnoDB: Uses event mutexes
2017-04-13T13:10:42.371062Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2017-04-13T13:10:42.371066Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2017-04-13T13:10:42.371389Z 0 [Note] InnoDB: Number of pools: 1
2017-04-13T13:10:42.371487Z 0 [Note] InnoDB: Using CPU crc32 instructions
2017-04-13T13:10:42.373341Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2017-04-13T13:10:42.385062Z 0 [Note] InnoDB: Completed initialization of buffer pool
2017-04-13T13:10:42.402413Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2017-04-13T13:10:42.456473Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2017-04-13T13:10:42.456722Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2017-04-13T13:10:42.498060Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2017-04-13T13:10:42.499778Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2017-04-13T13:10:42.499807Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2017-04-13T13:10:42.500089Z 0 [Note] InnoDB: Waiting for purge to start
2017-04-13T13:10:42.550861Z 0 [Note] InnoDB: 5.7.17 started; log sequence number 6305962580
2017-04-13T13:10:42.551099Z 0 [Note] InnoDB: Loading buffer pool(s) from /usr/local/var/mysql/ib_buffer_pool
2017-04-13T13:10:42.551345Z 0 [Note] Plugin 'FEDERATED' is disabled.
2017-04-13T13:10:42.555196Z 0 [Note] InnoDB: Buffer pool(s) load completed at 170413 13:10:42
2017-04-13T13:10:42.559085Z 0 [ERROR] unknown variable 'default-character-set=utf8'
2017-04-13T13:10:42.559125Z 0 [ERROR] Aborting
2017-04-13T13:10:42.559139Z 0 [Note] Binlog end
2017-04-13T13:10:42.559221Z 0 [Note] Shutting down plugin 'ngram'
2017-04-13T13:10:42.559253Z 0 [Note] Shutting down plugin 'partition'
2017-04-13T13:10:42.559266Z 0 [Note] Shutting down plugin 'BLACKHOLE'
2017-04-13T13:10:42.559300Z 0 [Note] Shutting down plugin 'ARCHIVE'
2017-04-13T13:10:42.559311Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2017-04-13T13:10:42.559387Z 0 [Note] Shutting down plugin 'MRG_MYISAM'
2017-04-13T13:10:42.559406Z 0 [Note] Shutting down plugin 'MyISAM'
2017-04-13T13:10:42.559430Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL'
2017-04-13T13:10:42.559439Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2017-04-13T13:10:42.559443Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2017-04-13T13:10:42.559447Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2017-04-13T13:10:42.559450Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2017-04-13T13:10:42.559453Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2017-04-13T13:10:42.559457Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2017-04-13T13:10:42.559460Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2017-04-13T13:10:42.559464Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2017-04-13T13:10:42.559467Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2017-04-13T13:10:42.559473Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2017-04-13T13:10:42.559477Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2017-04-13T13:10:42.559510Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2017-04-13T13:10:42.559514Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2017-04-13T13:10:42.559517Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2017-04-13T13:10:42.559523Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2017-04-13T13:10:42.559529Z 0 [Note] Shutting down plugin 'INNODB_METRICS'
2017-04-13T13:10:42.559535Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO'
2017-04-13T13:10:42.559539Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2017-04-13T13:10:42.559543Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2017-04-13T13:10:42.559546Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2017-04-13T13:10:42.559550Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2017-04-13T13:10:42.559588Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2017-04-13T13:10:42.559608Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2017-04-13T13:10:42.559622Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM'
2017-04-13T13:10:42.559629Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2017-04-13T13:10:42.559635Z 0 [Note] Shutting down plugin 'INNODB_CMP'
2017-04-13T13:10:42.559640Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2017-04-13T13:10:42.559665Z 0 [Note] Shutting down plugin 'INNODB_LOCKS'
2017-04-13T13:10:42.559674Z 0 [Note] Shutting down plugin 'INNODB_TRX'
2017-04-13T13:10:42.559681Z 0 [Note] Shutting down plugin 'InnoDB'
2017-04-13T13:10:42.559742Z 0 [Note] InnoDB: FTS optimize thread exiting.
2017-04-13T13:10:42.559798Z 0 [Note] InnoDB: Starting shutdown...
2017-04-13T13:10:42.665019Z 0 [Note] InnoDB: Dumping buffer pool(s) to /usr/local/var/mysql/ib_buffer_pool
2017-04-13T13:10:42.665949Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 170413 13:10:42
2017-04-13T13:10:44.125226Z 0 [Note] InnoDB: Shutdown completed; log sequence number 6305962599
2017-04-13T13:10:44.126507Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2017-04-13T13:10:44.126528Z 0 [Note] Shutting down plugin 'MEMORY'
2017-04-13T13:10:44.126540Z 0 [Note] Shutting down plugin 'CSV'
2017-04-13T13:10:44.126545Z 0 [Note] Shutting down plugin 'sha256_password'
2017-04-13T13:10:44.126549Z 0 [Note] Shutting down plugin 'mysql_native_password'
2017-04-13T13:10:44.126701Z 0 [Note] Shutting down plugin 'binlog'
2017-04-13T13:10:44.126824Z 0 [Note] /usr/local/Cellar/mysql/5.7.17/bin/mysqld: Shutdown complete
2017-04-13T13:10:44.6NZ mysqld_safe mysqld from pid file /usr/local/var/mysql/MyUser.local.pid ended