在 mac 用 brew 安装 mariadb 成功后( 先把原有的 mysql 卸载 ),然后启动 mysql, 结果报如下的错:
2017-02-24 22:13:27 140735232917504 [Note] mysqld (mysqld 10.1.21-MariaDB) starting as process 1002 ...
2017-02-24 22:13:27 140735232917504 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive
2017-02-24 22:13:28 140735232917504 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2017-02-24 22:13:28 140735232917504 [Note] InnoDB: The InnoDB memory heap is disabled
2017-02-24 22:13:28 140735232917504 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-02-24 22:13:28 140735232917504 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2017-02-24 22:13:28 140735232917504 [Note] InnoDB: Compressed tables use zlib 1.2.8
2017-02-24 22:13:28 140735232917504 [Note] InnoDB: Using SSE crc32 instructions
2017-02-24 22:13:28 140735232917504 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2017-02-24 22:13:28 140735232917504 [Note] InnoDB: Completed initialization of buffer pool
2017-02-24 22:13:28 140735232917504 [Note] InnoDB: Highest supported file format is Barracuda.
InnoDB: No valid checkpoint found.
InnoDB: If you are attempting downgrade from MySQL 5.7.9 or later,
InnoDB: please refer to http://dev.mysql.com/doc/refman/5.6/en/upgrading-downgrading.html
InnoDB: If this error appears when you are creating an InnoDB database,
InnoDB: the problem may be that during an earlier attempt you managed
InnoDB: to create the InnoDB data files, but log file creation failed.
InnoDB: If that is the case, please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.6/en/error-creating-innodb.html
2017-02-24 22:13:28 140735232917504 [ERROR] Plugin 'InnoDB' init function returned error.
2017-02-24 22:13:28 140735232917504 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2017-02-24 22:13:28 140735232917504 [Note] Plugin 'FEEDBACK' is disabled.
2017-02-24 22:13:28 140735232917504 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded
2017-02-24 22:13:28 140735232917504 [ERROR] Unknown/unsupported storage engine: InnoDB
2017-02-24 22:13:28 140735232917504 [ERROR] Aborting
后来找了资料,得到了解决方法,
把 /usr/local/var/mysql 目录删除,然后重装 mariadb 就可以了