设置 innodb_log_file_size 会导致 MySQL 崩溃

发布于 2024-07-09 02:06:56 字数 197 浏览 7 评论 0原文

因此,我希望能够将最大日志文件大小设置为 64M,但是在使用 innodb_log_file_size=64M 这样做之后,MySQL 启动正常,但似乎无法正常工作。

编辑:正确地说,我的意思是根本不。 设置其他 InnoDB 变量不会引起任何问题。

我应该如何解决这个问题?

So, I'd like to be able to set the max log file size to 64M, but after doing so with innodb_log_file_size=64M MySQL starts OK, but nothing seems to work properly.

EDIT: and by properly I mean not at all. Setting other InnoDB variables aren't causing any problems.

How should I go about troubleshooting this one?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

两人的回忆 2024-07-16 02:06:56

确保 MySQL 完全关闭,并从 MySQL 数据目录(通常为 /var/lib/mysql/)中删除(或移动到其他地方)所有 ib_logfile* 文件。

我已经测试过它并为我工作。 这是此提示的来源

InnoDB 在 show table status 注释字段中报告一些错误。 您会在 MySQL 错误日志(MySQL 数据目录中的 hostname.err)中发现其他问题。

Make sure MySQL shuts down cleanly, and delete (or move elsewhere) all ib_logfile* files from MySQL data directory (/var/lib/mysql/ usually).

I've tested it and worked for me. Here's source of this hint.

InnoDB reports some errors in show table status comment field. You'll find other problems in MySQL error log (hostname.err in MySQL data directory).

忆悲凉 2024-07-16 02:06:56

我也遇到了这个问题,根据 @porneL 的回答,这里是我纠正这个问题的具体 bash 步骤:

service mysql stop              # Stop MySQL
rm /var/lib/mysql/ib_logfile0   # Delete log file 1
rm /var/lib/mysql/ib_logfile1   # Delete log file 2
vim my.conf                     # Change innodb_log_file_size = 64M
service mysql start             # Start MySQL

我在 MySQL 论坛

I ran into this problem too, and as per @porneL's answer, here were my specific bash steps to correct this:

service mysql stop              # Stop MySQL
rm /var/lib/mysql/ib_logfile0   # Delete log file 1
rm /var/lib/mysql/ib_logfile1   # Delete log file 2
vim my.conf                     # Change innodb_log_file_size = 64M
service mysql start             # Start MySQL

I found these specific steps on the MySQL forums.

日记撕了你也走了 2024-07-16 02:06:56

在更改 innodb_log_file_size,您必须清除其中所有剩余的事务数据。 您只需设置 innodb_fast_shutdown 为 0 或 2。

  • innodb_fast_shutdown = 0 :InnoDB 在关闭之前执行缓慢关闭、完全清除和插入缓冲区合并
  • innodb_fast_shutdown = 2 :InnoDB 刷新其日志并冷关闭,就像 MySQL 崩溃一样; 已提交的事务不会丢失,但崩溃恢复操作会使下次启动时间更长。

鉴于此,这就是你处理它的方式

mysql -ANe"SET GLOBAL innodb_fast_shutdown = 2"
vi /etc/my.cnf                  # Change innodb_log_file_size = 64M
service mysql stop              # Stop MySQL
rm /var/lib/mysql/ib_logfile0   # Delete log file 1
rm /var/lib/mysql/ib_logfile1   # Delete log file 2
service mysql start             # Start MySQL

Before changing the innodb_log_file_size, you must flush all remaining transactional data out of it. You simply set innodb_fast_shutdown to 0 or 2.

  • innodb_fast_shutdown = 0 : InnoDB does a slow shutdown, a full purge and an insert buffer merge before shutting down
  • innodb_fast_shutdown = 2 : InnoDB flushes its logs and shuts down cold, as if MySQL had crashed; no committed transactions are lost, but the crash recovery operation makes the next startup take longer.

In light of this, this is how you handle it

mysql -ANe"SET GLOBAL innodb_fast_shutdown = 2"
vi /etc/my.cnf                  # Change innodb_log_file_size = 64M
service mysql stop              # Stop MySQL
rm /var/lib/mysql/ib_logfile0   # Delete log file 1
rm /var/lib/mysql/ib_logfile1   # Delete log file 2
service mysql start             # Start MySQL
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文