热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

ubuntu下处理mysql无法启动故障一例

故障现象:mysql无法启动1:dmesg|grepmysql[101353.820000]init:mysqlpost-startprocess(9077)terminatedw

故障现象:

mysql无法启动

1: dmesg |grep mysql

[101353.820000] init: mysql post-start process (9077) terminated with status 1
[101354.650000] init: mysql main process (9113) terminated with status 1
[101354.650000] init: mysql respawning too fast, stopped

2: grep mysql /var/log/syslog

213 Apr  1 19:35:33 Asiulo kernel: [101110.450000] init: mysql post-start process (8815) terminated with status 1
214 Apr  1 19:35:33 Asiulo kernel: [101110.590000] init: mysql main process (8846) terminated with status 1
215 Apr  1 19:35:33 Asiulo kernel: [101110.590000] init: mysql respawning too fast, stopped

3: tail -100 /var/log/mysql/error.log

  1 130401 10:27:28 [Note] Plugin 'FEDERATED' is disabled.
   2 130401 10:27:28 InnoDB: The InnoDB memory heap is disabled
   3 130401 10:27:28 InnoDB: Mutexes and rw_locks use GCC atomic builtins
   4 130401 10:27:28 InnoDB: Compressed tables use zlib 1.2.7
   5 130401 10:27:28 InnoDB: Using Linux native AIO
   6 130401 10:27:28 InnoDB: Initializing buffer pool, size = 128.0M
   7 130401 10:27:28 InnoDB: Completed initialization of buffer pool
   8 130401 10:27:28 InnoDB: highest supported file format is Barracuda.
   9 InnoDB: The log sequence number in ibdata files does not match
  10 InnoDB: the log sequence number in the ib_logfiles!
  11 130401 10:27:28  InnoDB: Database was not shut down normally!
  12 InnoDB: Starting crash recovery.
  13 InnoDB: Reading tablespace information from the .ibd files...
  14 InnoDB: Restoring possible half-written data pages from the doublewrite
  15 InnoDB: buffer...
  16 130401 10:27:28  InnoDB: Assertion failure in thread 3062129168 in file fsp0fsp.c line 2102
  17 InnoDB: Failing assertion: inode
  18 InnoDB: We intentionally generate a memory trap.
  19 InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
  20 InnoDB: If you get repeated assertion failures or crashes, even
  21 InnoDB: immediately after the mysqld startup, there may be
  22 InnoDB: corruption in the InnoDB tablespace. Please refer to
  23 InnoDB: http://dev.mysql.com/doc/refman/5.5/en/forcing-innodb-recovery.html
  24 InnoDB: about forcing recovery.
  25 02:27:28 UTC - mysqld got signal 6 ;
  26 This could be because you hit a bug. It is also possible that this binary
  27 or one of the libraries it was linked against is corrupt, improperly built,
  28 or misconfigured. This error can also be caused by malfunctioning hardware.
  29 We will try our best to scrape up some info that will hopefully help
  30 diagnose the problem, but since we have already crashed,
  31 something is definitely wrong and this may fail.
  32
  33 key_buffer_size=16777216
  34 read_buffer_size=131072
  35 max_used_cOnnections=0
  36 max_threads=151
  37 thread_count=0
  38 connection_count=0
  39 It is possible that mysqld could use up to
  40 key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 346079 K  bytes of memory
  41 Hope that's ok; if not, decrease some variables in the equation.
  42
  43 Thread pointer: 0x0
  44 Attempting backtrace. You can use the following information to find out
  45 where mysqld died. If you see no messages after this, something went
  46 terribly wrong...
  47 stack_bottom = 0 thread_stack 0x30000
  48 The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
  49 information that should help you find out what is causing the crash.

核实是INNODB出现故障导致。根据红色链接中的方法:

you can add the following line to the [mysqld] section of your option file before restarting the server:

[mysqld]
innodb_force_recovery = 4

将这个设置加入到/etc/mysql/my.cnf, 后start mysql服务恢复正常。

注释:

4 (SRV_FORCE_NO_IBUF_MERGE)

Prevent insert buffer merge operations. If they would cause a crash, do not do them. Do not calculate table statistics.

 

前期处理重新安装mysql的过程也记录下:

重新安装mysql

删除mysql:

apt-get autoremove --purge mysql-server

apt-get remove mysql-common

清理残留数据:

dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P

最后再执行下 apt-get autoremove

安装 mysql:
apt-get install mysql-server-5.5
apt-get install mysql-client-5.5  //正常情况,此步已经包含在上步中,无需再安装。
apt-get install php5-mysql

安装完毕执行

#dpkg-reconfigure重新配置
dpkg-reconfigure mysql-server-5.5

#quick mysql package check
dpkg -l *mysql*

禁止mysql做域名解析
[mysqld]
skip-name-resolve

 

完毕!


推荐阅读
  • 本文介绍了如何使用php限制数据库插入的条数并显示每次插入数据库之间的数据数目,以及避免重复提交的方法。同时还介绍了如何限制某一个数据库用户的并发连接数,以及设置数据库的连接数和连接超时时间的方法。最后提供了一些关于浏览器在线用户数和数据库连接数量比例的参考值。 ... [详细]
  • Oracle Database 10g许可授予信息及高级功能详解
    本文介绍了Oracle Database 10g许可授予信息及其中的高级功能,包括数据库优化数据包、SQL访问指导、SQL优化指导、SQL优化集和重组对象。同时提供了详细说明,指导用户在Oracle Database 10g中如何使用这些功能。 ... [详细]
  • Metasploit攻击渗透实践
    本文介绍了Metasploit攻击渗透实践的内容和要求,包括主动攻击、针对浏览器和客户端的攻击,以及成功应用辅助模块的实践过程。其中涉及使用Hydra在不知道密码的情况下攻击metsploit2靶机获取密码,以及攻击浏览器中的tomcat服务的具体步骤。同时还讲解了爆破密码的方法和设置攻击目标主机的相关参数。 ... [详细]
  • ubuntu用sqoop将数据从hive导入mysql时,命令: ... [详细]
  • 本文详细介绍了如何使用MySQL来显示SQL语句的执行时间,并通过MySQL Query Profiler获取CPU和内存使用量以及系统锁和表锁的时间。同时介绍了效能分析的三种方法:瓶颈分析、工作负载分析和基于比率的分析。 ... [详细]
  • WhenIusepythontoapplythepymysqlmoduletoaddafieldtoatableinthemysqldatabase,itdo ... [详细]
  • Vagrant虚拟化工具的安装和使用教程
    本文介绍了Vagrant虚拟化工具的安装和使用教程。首先介绍了安装virtualBox和Vagrant的步骤。然后详细说明了Vagrant的安装和使用方法,包括如何检查安装是否成功。最后介绍了下载虚拟机镜像的步骤,以及Vagrant镜像网站的相关信息。 ... [详细]
  • 分享css中提升优先级属性!important的用法总结
    web前端|css教程css!importantweb前端-css教程本文分享css中提升优先级属性!important的用法总结微信门店展示源码,vscode如何管理站点,ubu ... [详细]
  • 本文介绍了在Web应用系统中,数据库性能是导致系统性能瓶颈最主要的原因之一,尤其是在大规模系统中,数据库集群已经成为必备的配置之一。文章详细介绍了主从数据库架构的好处和实验环境的搭建方法,包括主数据库的配置文件修改和设置需要同步的数据库等内容。MySQL的主从复制功能在国内外大型网站架构体系中被广泛采用,本文总结了作者在实际的Web项目中的实践经验。 ... [详细]
  • PHP函数实现分页含文本分页和数字分页【PHP】
    后端开发|php教程PHP,分页后端开发-php教程最近,在项目中要用到分页。分页功能是经常使用的一个功能,所以,对其以函数形式进行了封装。影视网源码带充值系统,vscode配置根 ... [详细]
  • PeopleSoft安装镜像版本及导入语言包的方法
    本文介绍了PeopleSoft安装镜像的两个版本,分别是VirtualBox虚拟机版本和NativeOS版本,并详细说明了导入语言包的方法。对于Windows版本,可以通过psdmt.exe登录进入,并使用datamover脚本导入语言包。对于Linux版本,同样可以使用命令行方式执行datamover脚本导入语言包。导入语言包后,可以实现多种语言的登录。参考文献提供了相关链接以供深入了解。 ... [详细]
  • tcpdump 4.5.1 crash 深入分析
    tcpdump 4.5.1 crash 深入分析 ... [详细]
  • Linux下部署Symfoy2对app/cache和app/logs目录的权限设置,symfoy2logs
    php教程|php手册xml文件php教程-php手册Linux下部署Symfoy2对appcache和applogs目录的权限设置,symfoy2logs黑色记事本源码,vsco ... [详细]
  • Oracle 和 mysql的9点区别【MySQL】
    数据库|mysql教程oracle,Oracle,money,mysql,coun数据库-mysql教程1.组函数用法规则mysql中组函数在select语句中可以随意使用,但在o ... [详细]
  • 本文介绍了使用FormData对象上传文件同时附带其他参数的方法。通过创建一个表单,将文件和参数添加到FormData对象中,然后使用ajax发送POST请求进行文件上传。在发送请求时,需要设置processData为false,告诉jquery不要处理发送的数据;同时设置contentType为false,告诉jquery不要设置content-Type请求头。 ... [详细]
author-avatar
真实的小莹_808
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有