繁体   English   中英

MySQL 未启动,InnoDB 不可用

[英]MySQL not starting, InnoDB not available

客户端的服务器正在运行 MySQL 5.0。 昨晚服务器自动重启安装Windows更新。 重启后MySQL不想再运行了。 MySQL日志显示正常关机。 Windows 日志显示服务无法启动,因为“默认存储引擎 (InnoDB) 不可用”。 MySQL 在此之前多年运行良好,最近没有任何改变。

每天对数据进行备份,安装目录仍然存在。

如何让 MySQL 服务再次运行?

编辑:我刚刚在数据文件夹中的 server.err 文件中注意到以下内容:

InnoDB: Error: log file .\ib_logfile0 is of different size 0 10485760 bytes
InnoDB: than specified in the .cnf file 0 25165824 bytes!
120112  5:16:30 [ERROR] Default storage engine (InnoDB) is not available
120112  5:16:30 [ERROR] Aborting

你应该停止mysql服务器,删除日志文件并重新启动它。 它应该在事后发挥作用。 当然,先做好备份。 如果它不能正常工作,请尝试从修复链接。

您可以编辑.cnf ,搜索innodb_log_file_size参数并设置与ib_logfile0大小匹配的大小(以兆字节为单位)。

C:\\ MySql \\ data> dir

24/10/2012 08:47 24.117.248 ib_logfile0

Megas = 24117248/1024/1024 = 23

innodb_log_file_size = 23M

那试图启动服务。

干得好AleksandarVučetić

我从“mysql / data”中删除了这些文件:

- ib_logfile0
- ib_logfile1
- ibdata1

和MySQL服务再次启动。

MySQL日志说:

InnoDB: The first specified data file .\ibdata1 did not exist:
InnoDB: a new database to be created!
140719  0:57:55  InnoDB: Setting file .\ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
140719  0:57:55  InnoDB: Log file .\ib_logfile0 did not exist: new to be created
InnoDB: Setting log file .\ib_logfile0 size to 54 MB
InnoDB: Database physically writes the file full: wait...
140719  0:57:56  InnoDB: Log file .\ib_logfile1 did not exist: new to be created
InnoDB: Setting log file .\ib_logfile1 size to 54 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
140719  0:57:57  InnoDB: Started; log sequence number 0 0

在我的情况下,我删除了c:\\ windows \\ temp \\ myslql文件夹。 我再次在temp中创建了“mysql”文件夹,并且中提琴工作了!

就我而言,我可以通过以下命令解决此问题。 (在 Ubuntu 20.04 (LTS) x64 DigitalOcean 上)

  1. cd /var/lib/mysql
  2. mkdir '#innodb_redo'
  3. chown mysql:mysql '#innodb_redo'
  4. systemctl restart mysql

我以 root 身份进入服务器,但使用 sudo 时它应该可以正常工作。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM