每次服务器重启后 MySQL 都会损坏 [英] MySQL corrupts after every server restart

查看:47
本文介绍了每次服务器重启后 MySQL 都会损坏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个奇怪的问题.我正在 Windows 环境中运行 MySQL 和 Drupal 站点(不是自愿的,但这只是事情的结果)并且大多数时间该站点都很好,但是每次服务器重新启动(从更新或维护)MySQL数据库会损坏.

I Have a bit of an odd problem. I am running MySQL and Drupal site from a windows environment (not by choice but it is just how things have worked out) and most of the time the site is fine however every time the server is restarted (from updates or for maintenance) The MySQL Database will corrupt.

当我登录到 MySQL Workbench 时,我注意到服务器状态已停止,当我尝试启动它时出现错误:

When I log in to MySQL Work bench I notice that the server status is stopped and when I try to start it I get the error:

ERROR 致命错误:无法打开和锁定权限表:找不到文件:'user'(错误号:2 - 没有这样的文件或目录)

ERROR Fatal error: Can't open and lock privilege tables: Can't find file: 'user' (errno: 2 - No such file or directory)

然后 MySQL 服务器无法重新启动.

and then MySQL Server fails to restart.

解决此问题的唯一方法是删除 ProgramData/MySQL 中的数据文件夹,然后用全新安装的 MySQL 中的备份替换它,然后导入我的表的备份并重新创建我的用户.

The only way around this problem is to delete data folder in the ProgramData/MySQL and then replace it with a backup from a fresh install of MySQL then import a backup of my tables and recreate my users.

我的问题是是什么导致 MySQL 在每次服务器重启时损坏,我该怎么做才能防止这种情况继续发生?

My Question is what is causing MySQL to corrupt at every sever restart and what can I do to prevent this happening moving forward?

推荐答案

这对我有用:坚持使用 32 位.

卸载并确保在安装之前删除 mysql-data 文件夹及其所有子文件夹,并且更喜欢使用 32 位(有时 64 位版本是问题).

Uninstall and make sure you then DELETE the mysql-data folder and all its subfolders before installing, and prefer to use the 32 bit (sometimes 64 bit versions are the problem).

(来源)

这篇关于每次服务器重启后 MySQL 都会损坏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆