mysql “InnoDB: Unable to create temporary file; errno: 0” 问题解决办法

问题现象

服务器启动后Mysql服务启动异常,通过分析数据目录下的报错信息确认:

2023-06-12T05:55:28.462487Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2023-06-12T05:55:28.550103Z 0 [Warning] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
2023-06-12T05:55:28.760832Z 0 [Note] C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqld.exe (mysqld 5.7.17-log) starting as process 1832 ...
2023-06-12T05:55:32.836776Z 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2023-06-12T05:55:32.836776Z 0 [Note] InnoDB: Uses event mutexes
2023-06-12T05:55:32.836776Z 0 [Note] InnoDB: _mm_lfence() and _mm_sfence() are used for memory barrier
2023-06-12T05:55:32.836776Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2023-06-12T05:55:33.221428Z 0 [Note] InnoDB: Number of pools: 1
2023-06-12T05:55:33.497028Z 0 [Note] InnoDB: Not using CPU crc32 instructions
2023-06-12T05:56:46.686872Z 0 [ERROR] InnoDB: Unable to create temporary file; errno: 0
2023-06-12T05:56:46.687873Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2023-06-12T05:56:46.687873Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2023-06-12T05:56:46.688874Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2023-06-12T05:56:46.688874Z 0 [ERROR] Failed to initialize plugins.
2023-06-12T05:56:46.688874Z 0 [ERROR] Aborting

解决办法

通过对“Unable to create temporary file; errno: 0”问题排查了,无法生成临时文件,尝试了修改my.ini 增加tempdir配置临时文件路径

tmpdir=C:\ProgramData\MySQL\temp

重启仍然报错,网上有说文件路径"“要使用”\"斜杠替换

datadir=C:\\ProgramData\\MySQL\\data
tmpdir=C:\\ProgramData\\MySQL\\temp

修改后重启mysql服务,启动服务正常,问题解决;

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值