phpMyAdmin/nginx: 502 bad gateway 解决记录

本文详细解析了Nginx运行中遇到的MySQL错误日志信息,特别是关于.dota2目录下*.ibd文件的问题,并提供了有效的排查和修复步骤,最终通过删除备份文件使系统恢复正常。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  今天开机运行Nginx准备做本地测试,浏览器打开 phpMyAdmin 后提示 Nginx 进程崩溃。打开Nginx错误日志“error.log”没有任何有效信息。然后打开了phpMyAdmin的错误日志“***-PC.err”,提取有效信息如下:

140920 19:34:27 [Note] InnoDB: Using mutexes to ref count buffer pool pages

140920 19:34:27 [Note] InnoDB: The InnoDB memory heap is disabled

140920 19:34:27 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions

140920 19:34:27 [Note] InnoDB: Compressed tables use zlib 1.2.3

140920 19:34:27 [Note] InnoDB: Not using CPU crc32 instructions

140920 19:34:27 [Note] InnoDB: Initializing buffer pool, size = 128.0M

140920 19:34:27 [Note] InnoDB: Completed initialization of buffer pool

140920 19:34:27 [Note] InnoDB: Highest supported file format is Barracuda.

140920 19:34:27 [Note] InnoDB: The log sequence numbers 5900060 and 5900060 in ibdata files do not match the log sequence number 6080247 in the ib_logfiles!

140920 19:34:27 [Note] InnoDB: Database was not shutdown normally!

140920 19:34:27 [Note] InnoDB: Starting crash recovery.

140920 19:34:27 [Note] InnoDB: Reading tablespace information from the .ibd files...

2014-09-20 19:34:27 ec4  InnoDB: Operating system error number 2 in a file operation.

InnoDB: Some operating system error numbers are described at

InnoDB: http://dev.mysql.com/doc/refman/5.6/en/operating-system-error-codes.html

InnoDB: Error: could not open single-table tablespace file .\dota2\data_abilities - 

InnoDB: We do not continue the crash recovery, because the table may become

InnoDB: corrupt if we cannot apply the log records in the InnoDB log to it.

InnoDB: To fix the problem and start mysqld:

InnoDB: 1) If there is a permission problem in the file and mysqld cannot

InnoDB: open the file, you should modify the permissions.

InnoDB: 2) If the table is not needed, or you can restore it from a backup,

InnoDB: then you can remove the .ibd file, and InnoDB will do a normal

InnoDB: crash recovery and ignore that table.

InnoDB: 3) If the file system or the disk is broken, and you cannot remove

InnoDB: the .ibd file, you can set innodb_force_recovery > 0 in my.cnf

InnoDB: and force InnoDB to continue crash recovery here.

  可以看到错误代码为2,查了一下MySQL官方网站的错误代码描述是“No such file or directory”。再回到错误日志,错误代码的上一句是“Reading tablespace information from the .ibd files...”,下一句是“Error: could not open single-table tablespace file .\dota2\data_abilities -”。可以看出错误与数据库 .\dota2\ 目录下的 *.ibd 文件有关。打开该目录,果然有一个之前手动备份的文件 data_abilities - 副本.ibd。删除之,重启 Nginx 和 MySQL,再次打开 phpMyAdmin,恢复正常。


转载于:https://my.oschina.net/nghack/blog/316536

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值