无法使Mysql 8.0在Mac OS中保持打开状态

时间:2019-02-14 00:45:23

标签: mysql macos

MySQL突然无法保持打开状态。我试过了           ps -ef | grep MySQL的           须藤杀死-9 5211

我尝试删除my.cnf 我尝试按照上一篇文章的建议创建一个新的my.cnf

什么都没用。输入密码后,“系统偏好设置”中的mySQL打开,几秒钟后关闭。

这是错误日志:

2019-02-14T01:13:17.285925Z 0 [System] [MY-010116] [Server] /usr/local/Cellar/mysql/8.0.12/bin/mysqld (mysqld 8.0.12) starting as process 11402

 2019-02-14T01:13:17.288972Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive

 2019-02-14T01:13:17.317235Z 1 [ERROR] [MY-012592] [InnoDB] InnoDB: Operating system error number 2 in a file operation.
2019-02-14T01:13:17.317441Z 1 [ERROR] [MY-012593] [InnoDB] InnoDB: The error means the system cannot find the path specified.
2019-02-14T01:13:17.317548Z 1 [ERROR] [MY-012594] [InnoDB] InnoDB: If you are  installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.
 2019-02-14T01:13:17.317666Z 1 [ERROR] [MY-012646] [InnoDB] InnoDB: File ./ibdata1: 'open' returned OS error 71. Cannot continue operation
 2019-02-14T01:13:17.317798Z 1 [ERROR] [MY-012981] [InnoDB] InnoDB: Cannot continue operation.
 2019-02-14T01:15:15.776723Z 0 [System] [MY-010116] [Server] /usr/local/Cellar/mysql/8.0.12/bin/mysqld (mysqld 8.0.12) starting as process 12646
 2019-02-14T01:15:15.779642Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive
  2019-02-14T01:15:15.796296Z 1 [ERROR] [MY-012592] [InnoDB] InnoDB: Operating system error number 2 in a file operation.
  2019-02-14T01:15:15.796337Z 1 [ERROR] [MY-012593] [InnoDB] InnoDB: The error means the system cannot find the path specified.
   2019-02-14T01:15:15.796352Z 1 [ERROR] [MY-012594] [InnoDB] InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.
   2019-02-14T01:15:15.796365Z 1 [ERROR] [MY-012646] [InnoDB] InnoDB: File ./ibdata1: 'open' returned OS error 71. Cannot continue operation
   2019-02-14T01:15:15.796380Z 1 [ERROR] [MY-012981] [InnoDB] InnoDB: Cannot continue operation.

这是错误。我会检查它的意思。

1 个答案:

答案 0 :(得分:1)

由于您已经删除了.cnf文件,因此它期望当前文件夹中的./ibdata1文件,并且该文件不存在。通常,数据目录是在.cnf文件中使用datadir属性定义的。 例如

datadir=/var/lib/mysql

这个ibdata1在datadir文件夹中。