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

故障现象:

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

完毕!

时间: 2024-09-30 15:41:51

ubuntu下处理mysql无法启动故障一例的相关文章

ubuntu下的mysql的安装与配置

虽然项目紧张,仍然把一些基本的知识点纪录下分享,共用好开源的东西,创造实体价值! ubuntu下的mysql服务器安装配置如下: 一.安装方法 1.    sudo apt-get install mysql-server 2.    sudoapt-get install mysql-client 3.    sudo apt-get install libmysqlclient-dev 二.目录结构 新版本中的mysql和以前的目录结构有所变化: 启动脚本:/etc/init.d/ mysq

ubuntu下安装mysql出现FATAL ERROR: Could not find mysqld的处理

ubuntu下安装mysql出现FATAL ERROR: Could not find mysqld的处理 错误信息: #./bin/mysql_install_db –user=mysql FATAL ERROR: Could not find mysqld The following directories were searched: /usr/libexec /usr/sbin /usr/bin If you compiled from source, you need to run '

ubuntu 下配置MySQL服务

第一步 安装MySQL sudo apt-get install mysql-server 第二步 配置MySQL 2.1 vim /etc/mysql/my.cnf 找到bind-address = 127.0.0.1. 2.2 注释掉: #bind-address = 127.0.0.1 或者把IP改为 0.0.0.0:bind-address = 0.0.0.0 允许任意IP访问 2.3 重启 mysql服务: sudo /etc/inid.d/mysql restart 第三步 授权用户

AIX 5.3下Oracle 10g RAC 启动故障--CRS启动失败

AIX 5.3下Oracle 10g RAC 启动故障--CRS启动失败 系统环境: 操作系统: AIX 5300-09 集群软件: CRS 10.2.0.1 数据库:   Oracle 10.2.0.1                     系统架构图 故障现象: 系统重启后,在节点上CRS 启动失败或CRS服务启动成功,CRS Resource无法ONLINE. [[email protected] racg] cat /etc/hosts 127.0.0.1              

Ubuntu下安装MySql并在外网连接

纯新手教程. 1.安装mysql apt-get install mysql-server mysql-client libmysqlclient15-dev 安装过程中会提示为数据库root账户设置密码,输入两边密码即可 2.进入 mysql mysql -uroot -p 3.重新设置mysql用户root的密码 GRANT ALL PRIVILEGES ON *.* TO [email protected] IDENTIFIED BY "123456"; 4.创建新数据库 pro

Ubuntu下连接mysql出现 ERROR 1698 (28000): Access denied for user 'root'@'localhost'错误解决方法

ubuntu版本:18.04    mysql版本:5.7.24 ubuntu安装mysql后用root账户登入会出现问题:ERROR 1698 (28000): Access denied for user 'root'@'localhost' 可能是因为初始密码为空:按空格回车后还是报一样的错 这样就只能使用debian-sys-maint账户修改root账户密码了. debian-sys-maint账户是安装mysql时系统自动生成的mysql用户,debian和ubuntu系统都会这样做

Ubuntu下安装MySQL 并配置root账号远程访问

# 查看有没有安装MySQL: dpkg -l | grep mysql # 安装MySQL: apt install mysql-server 安装完成之后可以使用如下命令来检查是否安装成功: netstat -tap | grep mysql 通过上述命令检查之后,如果看到有 mysql 的socket处于 LISTEN 状态则表示安装成功. 登录mysql数据库可以通过如下命令: mysql -u root -p -u 表示选择登陆的用户名, -p 表示登陆的用户密码,现在是mysql数据

ubuntu下修改mysql默认data路径

由于ubuntu默认的mysql路径是在/var/lib/mysql下,很多时候我们如果没有挂载其它分区在/var的时候,随着网站逐渐浏览和添加内容,数据容量也会越来越大,自然磁盘空间也会比较吃紧.因此我们就需要把mysql的data路径转移到其它目录下. 今天在转移的时候走了不少弯路,最后经过反复尝试后得到了比较精简的步骤,提炼如下. 设置新data路径(假设新路径为/data/mysql)这里需要说明的就是,最开始我图省事使用了mv来移动,随后发现在设置完路径后mysql无法访问.因此为了保

Ubuntu下安装MySQL

在Linux下安装MySQL有三种方式:第一种以rpm的二进制文件分个安装,第二种是自己编译源码后安装,最后一种是以二进制tar.gz文件来安装. 这三种中,由于最后一种是统一的整体文件,个人感觉最简单,故本文将采用此方式来进行安装: 首先到mysql的下载中心上下载最新的tar.gz包: 1.在浏览器中输入http://www.mysql.com/downloads/,进入mysql的下载中心,在这里有使用mysql开发的一些工具,包括mysql的驱动,数据库以及图形开发工具MySQL Wor