phpstudy mysql5.7无法启动成功

phpStudy中无法启动Mysql5.7,不是端口冲突的问题。由于前一段时间还试用过phpEnv,怀疑是两个集成环境有冲突,分别在phpstudy和phpenv里都试着重启,均以失败告终。

在命令行下启用,查看提示信息

D:\phpstudy\Extensions\MySQL5.7.26\bin\mysqld --initialize --console

D:\phpEnv\server\mysql\mysql-5.7\bin\mysqld --initialize --console

2021-06-26T22:07:27.019190+08:00 0 [ERROR] --initialize specified but the data directory has files in it. Aborting.
2021-06-26T22:07:27.019639+08:00 0 [ERROR] Aborting

按照提示清空data文件夹里的内容后再次执行,提示

D:\phpEnv>D:\phpEnv\server\mysql\mysql-5.7\bin\mysqld --initialize --console
2021-06-26T22:13:34.165383+08:00 0 [ERROR] InnoDB: Unable to create temporary file; errno: 2
2021-06-26T22:13:34.165602+08:00 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2021-06-26T22:13:34.166244+08:00 0 [ERROR] Plugin ‘InnoDB‘ init function returned error.
2021-06-26T22:13:34.166445+08:00 0 [ERROR] Plugin ‘InnoDB‘ registration as a STORAGE ENGINE failed.
2021-06-26T22:13:34.166641+08:00 0 [ERROR] Failed to initialize builtin plugins.
2021-06-26T22:13:34.166846+08:00 0 [ERROR] Aborting

phpstudy mysql5.7无法启动成功

创建临时文件失败。打开我的电脑 - 属性 - 高级系统设置 - 环境变量,在用户变量和系统变量中涉及到temp/tmp的选项逐一排查,发现系统变量TMPDIR所指向的文件夹不存在,因为前段时间确实清理过这个文件夹,重新建立文件夹之后,故障解除,mysql启动成功。

phpstudy mysql5.7无法启动成功

上一篇:13. Mysql之二进制日志(binlog)


下一篇:Android Binder机制 -- libbinder