文章目录

前言

后记

前言

问题保留,如果有大佬会可以留言教我一下!

因为做的cacti没有做完,回家的时候就将电脑从休眠状态起不来。于是我就断电重启。自此mysql就不正常了,一直出现报错。因为之前部署zabbix出现过同样的问题,当时直接重装了系统。这次希望能用心解决一下,积累自己的排错经验。

1.查看端口状态,看是否开启:

[root@server1 mariadb]# netstat -tnlp

tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 45129/mysqld

2.服务状态running:

[root@server1 mariadb]# systemctl status mariadb

● mariadb.service - MariaDB database server

Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)

Active: active (running) since Thu 2020-07-09 09:39:24 CST; 10min ago

Process: 32031 ExecStartPost=/usr/libexec/mariadb-wait-ready $MAINPID (code=exited, status=0/SUCCESS)

Process: 31999 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir %n (code=exited, status=0/SUCCESS)

Main PID: 32030 (mysqld_safe)

Tasks: 32

CGroup: /system.slice/mariadb.service

├─32030 /bin/sh /usr/bin/mysqld_safe --basedir=/usr

├─46481 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql ...

└─46641 addr2line -C -f -e /usr/libexec/mysqld

Jul 09 09:39:21 server1 systemd[1]: Starting MariaDB database server...

Jul 09 09:39:21 server1 mariadb-prepare-db-dir[31999]: Database MariaDB is prob...

Jul 09 09:39:22 server1 mysqld_safe[32030]: 200709 09:39:22 mysqld_safe Loggin....

Jul 09 09:39:22 server1 mysqld_safe[32030]: 200709 09:39:22 mysqld_safe Starti...l

Jul 09 09:39:24 server1 systemd[1]: Started MariaDB database server.

Hint: Some lines were ellipsized, use -l to show in full.

看起来并没有异常。

3.用root用户登录mysql

[root@server1 mariadb]# mysql -uroot -p

Enter password:

Welcome to the MariaDB monitor. Commands end with ; or \g.

Your MariaDB connection id is 1

Server version: 5.5.60-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>

可以正常登录

4.show databases;!!!!出现报错

MariaDB [(none)]> show databases;

ERROR 2006 (HY000): MySQL server has gone away

No connection. Trying to reconnect...

Connection id: 2

Current database: *** NONE ***

+--------------------+

| Database |

+--------------------+

| information_schema |

| cacti |

| mysql |

| performance_schema |

| test |

| zabbix |

+--------------------+

6 rows in set (0.01 sec)

分析:

mysql没了,我们之前的端口检查和服务检查都看到我们的MySQL了,这里怎么没了?

我准备先查系统日志,再查mysql日志。

系统日志:

[root@server1 mariadb]# date

Thu Jul 9 09:58:17 CST 2020

[root@server1 mariadb]# journalctl -xe

Jul 09 09:57:34 server1 kernel: traps: mysqld[60957] general protection ip:55c1a613ffc1 sp:7f904201d5c0 error:0 in mysqld[55c1a5a05000+cb2000]

Jul 09 09:57:34 server1 abrt-hook-ccpp[60980]: Process 60129 (mysqld) of user 27 killed by SIGSEGV - dumping core

Jul 09 09:57:37 server1 abrt-hook-ccpp[60980]: Failed to create core_backtrace: waitpid failed: No child processes

Jul 09 09:57:37 server1 abrtd[7224]: Size of '/var/spool/abrt' >= 1000 MB (MaxCrashReportsSize), deleting new directory 'ccpp-2020-07-09-09:57:34

Jul 09 09:57:48 server1 kernel: traps: mysqld[61511] general protection ip:5632be90ffc1 sp:7f78080e95c0 error:0 in mysqld[5632be1d5000+cb2000]

Jul 09 09:57:48 server1 abrt-hook-ccpp[61520]: Process 61068 (mysqld) of user 27 killed by SIGSEGV - ignoring (repeated crash)

Jul 09 09:57:58 server1 kernel: traps: mysqld[61852] general protection ip:55bb0c387fc1 sp:7f3c4426e5b0 error:0 in mysqld[55bb0bc4d000+cb2000]

Jul 09 09:57:59 server1 abrt-hook-ccpp[61861]: Process 61544 (mysqld) of user 27 killed by SIGSEGV - dumping core

Jul 09 09:58:01 server1 abrt-hook-ccpp[61861]: Failed to create core_backtrace: waitpid failed: No child processes

Jul 09 09:58:01 server1 abrtd[7224]: Size of '/var/spool/abrt' >= 1000 MB (MaxCrashReportsSize), deleting new directory 'ccpp-2020-07-09-09:57:59

lines 1469-1490/1490 (END)

mysql的日志,有error的部分为:

InnoDB: End of page dump

200709 10:06:22 InnoDB: Page checksum 1575996416 (32bit_calc: 2253597184), prior-to-4.0.14-form checksum 1371122432

InnoDB: stored checksum 0, prior-to-4.0.14-form stored checksum 0

InnoDB: Page lsn 0 0, low 4 bytes of lsn at page end 0

InnoDB: Page number (if stored to page already) 0,

InnoDB: space id (if created with >= MySQL-4.1.1 and stored already) 0

InnoDB: Page may be a freshly allocated page

200709 10:06:22 [ERROR] mysqld got signal 11 ;

This could be because you hit a bug. It is also possible that this binary

or one of the libraries it was linked against is corrupt, improperly built,

or misconfigured. This error can also be caused by malfunctioning hardware.

To report this bug, see http://kb.askmonty.org/en/reporting-bugs

We will try our best to scrape up some info that will hopefully help

diagnose the problem, but since we have already crashed,

something is definitely wrong and this may fail.

Server version: 5.5.60-MariaDB

key_buffer_size=134217728

read_buffer_size=131072

max_used_connections=12

max_threads=153

thread_count=12

It is possible that mysqld could use up to

key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 466718 K bytes of memory

Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x563221b9cc30

Attempting backtrace. You can use the following information to find out

where mysqld died. If you see no messages after this, something went

terribly wrong...

InnoDB: Page directory corruption: infimum not pointed to

200709 10:06:22 InnoDB: Page dump in ascii and hex (16384 bytes):

到现在,我终于看到了一条error:

200709 10:06:22 [ERROR] mysqld got signal 11 ;

详细查看一下:

[root@server1 mariadb]# perror 11

OS error code 11: Resource temporarily unavailable

说是资源暂时不可用。

现在journal中的红色报错也没解决。

再使用用户身份登录时:

断电前创建:

unknown [(none)]> use zabbix;

No connection. Trying to reconnect...

Connection id: 1

Current database: *** NONE ***

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A

Database changed

断电后创建:

MariaDB [(none)]> use cacti;

No connection. Trying to reconnect...

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)

ERROR: Can't connect to the server

两个报错是不一样的。查日志:

InnoDB: End of page dump

200709 10:19:41 InnoDB: Page checksum 1575996416 (32bit_calc: 2253597184), prior-to-4.0.14-form checksum 1371122432

InnoDB: stored checksum 0, prior-to-4.0.14-form stored checksum 0

InnoDB: Page lsn 0 0, low 4 bytes of lsn at page end 0

InnoDB: Page number (if stored to page already) 0,

InnoDB: space id (if created with >= MySQL-4.1.1 and stored already) 0

InnoDB: Page may be a freshly allocated page

200709 10:19:41 [ERROR] mysqld got signal 11 ;

This could be because you hit a bug. It is also possible that this binary

or one of the libraries it was linked against is corrupt, improperly built,

or misconfigured. This error can also be caused by malfunctioning hardware.

To report this bug, see http://kb.askmonty.org/en/reporting-bugs

We will try our best to scrape up some info that will hopefully help

diagnose the problem, but since we have already crashed,

something is definitely wrong and this may fail.

Server version: 5.5.60-MariaDB

key_buffer_size=134217728

read_buffer_size=131072

max_used_connections=14

max_threads=153

thread_count=14

It is possible that mysqld could use up to

key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 466718 K bytes of memory

Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x55902ed56b10

Attempting backtrace. You can use the following information to find out

where mysqld died. If you see no messages after this, something went

terribly wrong...

stack_bottom = 0x7f639c9d9d80 thread_stack 0x48000

其实问题都一样,日志报错也一样。

现在自己问题已经出来了,我先做个记录。暂停一下,去搜索有没有人遇到和我一样的问题。

嘻嘻,发现这种问题大家遇到的还挺多的,开心!

1小时后,发现经过修改后启都启不来了,因为还要照顾进度,就不杠了,重装,真香^ - ^

参考博客:

后记

mysql停电_MySQL断电后报错处理相关推荐

  1. mysql安装到最后报错_mysql 安装到最后一步时,start service 为失败状态

    方式2 查看服务中有没有mysql,如果有将该服务停掉; 安装mysql 5.1.33,在运行Server Instance Configuration wizard时的Execute configu ...

  2. 读取MySQL二进制文件_MYSQL: mysqlbinlog读取二进制文件报错read_log_event()

    一.问题描述 mysql v 5.0.91 [root@localhost bin]# ./mysqlbinlog /tmp/mysql-bin.000015 /!40019 SET @@sessio ...

  3. mysql之间互相订阅_Mysql分区报错,另外小说订阅表如何优化?

    CREATE TABLE `yy_subscribe2` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `user_id` int(10) unsi ...

  4. mysql字段超长会报错吗_MySQL使用过程中的报错处理(持续更新)

    MySQL使用过程中的报错处理(持续更新) 一.数据库初始化 1.Percona的MySQL 5.6.20版本数据库初始化 初始化命令(MySQL 5.6版本不适用mysqld命令进行初始化) ./s ...

  5. mysql plugin 空_mysql 启动报错 Could not open mysql.plugin table 的修复

    mysql突然崩,重启就打不开了,将data目录下的东西删了一些,很不幸,删多了,只得寻求恢复办法,直接备份整个data目录,新建一个data空目录,尝试启动mysql,发现有报错Could not ...

  6. jspstudy启动mysql失败_MySql启动数据库设置初始密码

    这一小节介绍在Mac OS.Linux.Windows上启动关闭重启MySQL服务,以及部分图形化界面对服务的操控.安装完成后,可以使用 service 命令启动 mysql 服务,在Mac上serv ...

  7. golang mysql 崩溃_mysql连接问题,goruntime里执行总是出错,程序一直崩溃

    初学golang,尝试写一个程序,但是在mysql操作时遇到了问题~ 看网上文章,推荐mysql直接创建一个db全局变量,然后连接一次,以后使用到直接用这个db,我按照这样的方法,然后进行操作,可是程 ...

  8. java工作空间报错,java更改工作空间后报错

    java更改工作空间后报错 [2021-02-10 21:27:05]  简介: php去除nbsp的方法:首先创建一个PHP代码示例文件:然后通过"preg_replace("/ ...

  9. MySQLbackup备份MySQL主从_mysql扩展:xtrabackup备份和做主从

    xtrabackup 只能备份引擎为innodb的数据 后来innobackeupex 则可以备份mysiam (使用mysqldump 备份大量数据时会很慢,使用xtrabackup则很快,且把所有 ...

最新文章

  1. 任正非公开信深度解读:两年怎样改变了华为?
  2. 通用权限管理系统组件 中集成多个子系统的单点登录(网站入口方式)附源码
  3. nginx自签SSL证书和Symantec签发证书使用
  4. libtorch Compiler Error C2951
  5. ITK:比较两个图像并将输出像素设置为最小值
  6. 11.2.3 事件
  7. 【进阶技巧】如何绘制高颜值XMind思维导图?色彩使用很重要!
  8. 关于vmware中的centos无法ping通宿主机或者是外网的解决思路
  9. JSK-16 爬楼梯【基础】
  10. C语言数据结构各种结构体的定义
  11. 电脑、手机 自动化 键鼠操作( 类似按键精灵 )
  12. STM8L建立IAR工程
  13. 使用H5编写网页版象棋(源码)
  14. vue3中的beforeEach里面的next函数---刷新页面导致白页
  15. java面试常见知识点整理
  16. 三基色配色表java_【调色】颜色配色表 适合重彩搭配用
  17. Java、JSP教师信息管理系统
  18. Python 画星星图案
  19. 如何把Word的默认页面颜色由白色改为绿色
  20. 微软NNI进行神经网络模型剪枝压缩的踩坑记录

热门文章

  1. Linux常用命令以及vim的使用
  2. 订单支付页面 html,订单支付完成.html
  3. AI基础——一阶谓词逻辑表示法
  4. 【干货】 xgboost如何自定义eval_metric ( feval ) ?
  5. 黑洞信息悖论:进入黑洞的信息去了哪里
  6. Google关键词排名多久做上去?谷歌新网站多久能有排名?
  7. struct timeval
  8. 数据库oracle11g的存储结构
  9. mac怎么删除下载文件及MAC电脑浏览器如何清除缓存?
  10. 物联网设备数据流转之告警信息推送:TDengine-alert