首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >我的MySQL在一个月里崩溃了很多次

问我的MySQL在一个月里崩溃了很多次
EN

Server Fault用户
提问于 2021-01-25 03:59:59
回答 2查看 1.4K关注 0票数 2

我的网站(Wordpress)有时会停止使用下面的错误信息“

无法连接到数据数据库

我检查了MySQL的日志文件,发现了crash,如下所示:

代码语言:javascript
复制
---------- 
2021-01-21  0:44:59 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2021-01-21  0:44:59 0 [Note] InnoDB: Uses event mutexes
2021-01-21  0:44:59 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-01-21  0:44:59 0 [Note] InnoDB: Number of pools: 1
2021-01-21  0:45:00 0 [Note] InnoDB: Using SSE2 crc32 instructions
2021-01-21  0:45:00 0 [Note] InnoDB: Initializing buffer pool, total size = 16M, instances = 1, chunk size = 16M
2021-01-21  0:45:00 0 [Note] InnoDB: Completed initialization of buffer pool
2021-01-21  0:45:00 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2021-01-21  0:45:00 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=215993122
2021-01-21  0:45:07 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2021-01-21  0:45:07 0 [Note] InnoDB: Uses event mutexes
2021-01-21  0:45:07 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-01-21  0:45:07 0 [Note] InnoDB: Number of pools: 1
2021-01-21  0:45:07 0 [Note] InnoDB: Using SSE2 crc32 instructions
2021-01-21  0:45:07 0 [Note] InnoDB: Initializing buffer pool, total size = 16M, instances = 1, chunk size = 16M
2021-01-21  0:45:07 0 [Note] InnoDB: Completed initialization of buffer pool
2021-01-21  0:45:07 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2021-01-21  0:45:07 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=215993122
2021-01-21  0:50:02 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2021-01-21  0:50:02 0 [Note] InnoDB: Uses event mutexes
2021-01-21  0:50:02 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-01-21  0:50:02 0 [Note] InnoDB: Number of pools: 1
2021-01-21  0:50:02 0 [Note] InnoDB: Using SSE2 crc32 instructions
2021-01-21  0:50:02 0 [Note] InnoDB: Initializing buffer pool, total size = 16M, instances = 1, chunk size = 16M
2021-01-21  0:50:02 0 [Note] InnoDB: Completed initialization of buffer pool
2021-01-21  0:50:02 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2021-01-21  0:50:02 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=215993122
2021-01-21  0:50:02 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2021-01-21  0:50:02 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2021-01-21  0:50:02 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2021-01-21  0:50:02 0 [Note] InnoDB: Setting file '/opt/lampp/var/mysql/ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2021-01-21  0:50:02 0 [Note] InnoDB: File '/opt/lampp/var/mysql/ibtmp1' size is now 12 MB.
2021-01-21  0:50:02 0 [Note] InnoDB: Waiting for purge to start
2021-01-21  0:50:02 0 [Note] InnoDB: 10.4.11 started; log sequence number 215993131; transaction id 221150
2021-01-21  0:50:02 0 [Note] Plugin 'FEEDBACK' is disabled.
2021-01-21  0:50:02 0 [Note] InnoDB: Loading buffer pool(s) from /opt/lampp/var/mysql/ib_buffer_pool
2021-01-21  0:50:02 0 [Note] Server socket created on IP: '::'.
---------- 

我重新启动了MySQL,我的网站运行得很好。我的MySQL的版本是:x86_64 10.4.11-MariaDB,用于Linux (x86_64) Ubuntu 20。

这种情况在一个月前出现过几次。

我曾经在一些帖子里搜索过这个解决方案,但是仍然不能解决这个问题,

MySQL服务器每周至少崩溃2次.

Wordpress + PHP+ apache +mysql,mysql每一个月崩溃一次

有人被困在这个案子里,知道怎么解决吗?

EN

回答 2

Server Fault用户

发布于 2021-01-25 13:10:57

在XAMPP控制面板上启动MySQL。

单击XAMPP控制面板上的Logs按钮,检查mysql_error.log日志“mysql_error.log”。

转到MySQL数据库中的“data”目录。我在我的计算机上安装了XAMPP :驱动器&我的计算机的MySQL“data”目录位置是“/opt/lampp/var/mysql/”。你可能有不同的位置。

备份MySQL“数据”文件夹

首先,您应该使用任何压缩软件创建“data”文件夹的备份。

给一个像“data_backup.zip”这样的名字或者你想要的任何类型的压缩。我使用WinRAR压缩软件来压缩和备份MySQL的“数据”文件夹。

重命名“data”文件夹

将“data”文件夹重命名为“data-oldfiles”。这对于将数据目录重命名为任何新目录名非常重要。创建一个新的“数据”文件夹

创建一个新文件夹,并将该文件夹命名为“data”。

为了解决这个问题,我们需要在mysql数据库中创建一个新的“数据”目录。从“备份”文件夹复制内容

转到“备份”文件夹并复制所有文件。

将文件从备份文件夹粘贴到数据文件夹

现在从XAMPP启动MySQL数据库。

现在,您的MySQL数据库将正确启动,而不会显示任何错误。

传输所有MySQL项目数据库、数据文件和日志文件

如果您有许多用于各种项目的数据库,那么您必须将所有数据库从“data-oldfiles”文件夹转移到“data”文件夹。

复制数据旧文件中的所有数据库并粘贴到数据文件夹。

现在,您必须将数据文件“ibdata1”&所有日志文件“ib_logfile0,ib_logfile1”从数据旧文件文件夹复制到数据文件夹。如果您有很多id_logiles,那么就复制它们。

MySQL错误--这可能是由于阻塞端口、缺少依赖项、不正确的权限、崩溃或另一种方法关闭造成的。从XAMPP启动MySQL

现在从XAMPP启动MySQL。

转到phpMyAdmin检查所有数据库是否可用&正在工作。

票数 0
EN

Server Fault用户

发布于 2021-02-03 08:27:13

16M对于innodb_buffer_pool_size来说太小了,试试50M。1GB的VM非常小。

同时将max_connections降低到10。

票数 0
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/1051060

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档