mysql - 无法让 Mysql 8.0 在 Mac OS 中保持打开状态
问题描述
MySQL突然无法保持打开状态。我试过 ps -ef | grep mysql sudo kill -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.
这是错误。我会检查它的含义。
解决方案
由于您已删除 .cnf 文件,因此在当前文件夹中需要 ./ibdata1 文件,但它不存在。通常数据目录定义在带有datadir
属性的 .cnf 文件中。例如
datadir=/var/lib/mysql
这个 ibdata1 在 datadir 文件夹中。
推荐阅读
- python - 使用多个 def 函数修改列表
- javascript - this.someFunc.bind(this, a, b, c) Vs () => this.someFunc(a, b, c)
- java - 本机 jvm 文件(Object.c、Class.c)编译/链接到哪里?
- c++ - 我可以使用在类构造函数中初始化的流类型的成员变量吗?
- javascript - 使用 .mjs 文件扩展名 js 模块
- rabbitmq - 使用 Spring-context 进行集成测试不接收 RabbitMQ 消息
- c++ - 在现代 CMake 中将接口库添加为 SYSTEM
- c# - .NET System.Security.Cryptographic 中来自 CAPICOM 的 AES 解密
- jmeter - 如何根据命令行传入的Environment参数执行Jmeter脚本
- qt - 如何将 QTableWidget + QComboBox 放在一起,如果值从同一行的 QComboBox 更改,如何访问特定行