一般来说有经验的管理员在部署操作系统时通常会将操作系统本身与应用软件分离,将两者安装在不同的磁盘或者分区中,并且会保证有一定的资源余量以满足后期长期运行的需要。但是在虚拟化环境中一般经常遭遇资源比较紧张、管理比较混乱的情况,特别是资源浪费非常严重,往往是资源分配不均、最初对物理服务器测量不准确导致的。不管是什么原因,只有拿出时间去及时的清理、解决问题就是一种良性运维,否则日后虚拟机累积成几百个就非常麻烦了,特别是模板出现问题就非常严重。

数据库系统往往是要求最苛刻的应用,不仅对CPU内存要求苛刻(特别是内存),对硬盘速度(I/O)和大小都有较为苛刻的要求。在部署MySQL数据库时分配较大的内存较大较快的硬盘是值得的,至少要对my.cnf文件进行仔细的配置才行。当然了最好还是对物理服务器进行有效的评估,先制定一个满足运行条件的脚本系统配置,优化后再统计一段相当长时间的运行情况,CPU、内存、硬盘和网络的压力是怎么样分布的,峰值时间集中在哪一个阶段,再结合日志分析后再得出一个比较准确的配置和优化结果。

从MySQL数据库的配置文件/etc/my.cnf种找到日志存在的位置,确定无误后删除错误日志。

[root@zabbixserver ~]# rm -rf /var/log/mysqld.log

重新启动一次MySQL数据库,观察错误日志。   
[root@zabbixserver ~]# service mysqld start     
MySQL Daemon failed to start.     
Starting mysqld:                                           [FAILED]     
[root@zabbixserver ~]# cat /var/log/mysqld.log     
140505 11:22:52 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql     
140505 11:22:52  InnoDB: Initializing buffer pool, size = 8.0M     
140505 11:22:52  InnoDB: Completed initialization of buffer pool     
InnoDB: Log scan progressed past the checkpoint lsn 2 2955725186     
140505 11:22:52  InnoDB: Database was not shut down normally!     
InnoDB: Starting crash recovery.     
InnoDB: Reading tablespace information from the .ibd files...     
InnoDB: Restoring possible half-written data pages from the doublewrite     
InnoDB: buffer...     
InnoDB: Doing recovery: scanned up to log sequence number 2 2955745512     
InnoDB: 1 transaction(s) which must be rolled back or cleaned up     
InnoDB: in total 4 row operations to undo     
InnoDB: Trx id counter is 0 43004160     
140505 11:22:52  InnoDB: Starting an apply batch of log records to the database...     
InnoDB: Progress in percents: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99     
InnoDB: Apply batch completed     
InnoDB: Last MySQL binlog file position 0 1735848, file name ./mysql-bin.000018     
InnoDB: Starting in background the rollback of uncommitted transactions     
140505 11:22:52  InnoDB: Rolling back trx with id 0 41354738, 4 rows to undo     
140505 11:22:52  InnoDB: Started; log sequence number 2 2955745512     
140505 11:22:52 [Note] Recovering after a crash using mysql-bin     
140505 11:22:52 [ERROR] Error in Log_event::read_log_event(): 'read error', data_len: 990, event_type: 24     
140505 11:22:52 [Note] Starting crash recovery...     
140505 11:22:52 [Note] Crash recovery finished.     
03:22:52 UTC - 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.     
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.

key_buffer_size=8384512    
read_buffer_size=131072     
max_used_connections=0     
max_threads=700     
thread_count=0     
connection_count=0     
It is possible that mysqld could use up to     
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 1538661 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x0    
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 = 0 thread_stack 0x40000     
/usr/libexec/mysqld(my_print_stacktrace+0x29) [0x84f539]     
/usr/libexec/mysqld(handle_fatal_signal+0x483) [0x6a3713]     
/lib64/libpthread.so.0(+0xf500) [0x7ff1f5519500]     
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains     
information that should help you find out what is causing the crash.     
140505 11:22:52 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended     
[root@zabbixserver ~]# grep error  /var/log/mysqld.log     
140505 11:22:52 [ERROR] Error in Log_event::read_log_event(): 'read error', data_len: 990, event_type: 24     
or misconfigured. This error can also be caused by malfunctioning hardware.

根据经验先看看磁盘空间够不够用,果不其然。如果着急只能将二进制日志停掉先将服务启动再说,如果不着急那就只能扩容或者迁移到大硬盘上去了。当然了MySQL Cluster以及主从之类的需要额外处理。

[root@zabbixserver ~]# df -h   
Filesystem            Size  Used Avail Use% Mounted on   
/dev/mapper/VolGroup-lv_root   
                      12G   11G     0 100% /   
tmpfs                 1.9G     0  1.9G   0% /dev/shm   
/dev/sda1             485M   32M  428M   7% /boot   
[root@zabbixserver ~]#

将二进制日志先禁用掉,如下图所示:

接下来数据库就能暂时平安无事了,如下图所示:

本文转自 urey_pp 51CTO博客,原文链接:http://blog.51cto.com/dgd2010/1406691,如需转载请自行联系原作者

MySQL数据库无法启动的简单排错相关推荐

  1. mysql cleaned up_MySQL数据库无法启动的简单排错

    一般来说有经验的管理员在部署操作系统时通常会将操作系统本身与应用软件分离,将两者安装在不同的磁盘或者分区中,并且会保证有一定的资源余量以满足后期长期运 一般来说有经验的管理员在部署操作系统时通常会将操 ...

  2. 导入数据库显示服务器发生意外,mysql 数据库无法启动(Ignoring the redo log due to missing M...

    mysql 数据库无法启动(Ignoring the redo log due to missing M mysql 数据库无法启动(Ignoring the redo log due to miss ...

  3. MySql数据库记录相差14小时排错,使用Java访问Mysql数据库时出现时区异常的解决方案

    最近遇到1个大坑,A系统迁移到B系统,2边系统 同1个字段 createTime 看到的不一致. 表象: A系统: 2019-6-10 17:34 B系统: 2019-6-11 .... 再次尝试: ...

  4. mysql远程一会不用卡住_连接远程MySQL数据库项目启动时,不报错但是卡住不继续启动的,...

    连接远程MySQL数据库项目启动时,不报错但是卡住不继续启动的, 2018-03-12 17:08:52.532DEBUG[localhost-startStop-1]o.s.beans.factor ...

  5. MySQL新手入门:MySQL数据库的启动与连接

    上一篇文章,讲解了MySQL数据库的安装,本文将会讲解MySQL数据库的启动及连接. MySQL数据库安装完成后,其实已经是启动状态了,但是,有时候修改了MySQL的配置文件(my.ini),需要重新 ...

  6. mysql数据库没启动命令_mysql数据库服务启动和停止命令介绍(转载)

    mysql数据库启动与停止我这里给大家介绍在windows系统与linux内核的各种系统中的操作命令,希望对大家会有所帮助哦. MySQL在windows.Linux的启动.停止的方法 一.windo ...

  7. mysql-bin磁盘满数据库重启不_liunx磁盘空间满了,导致mysql数据库无法启动

    如何启动/遏制/重启MySQLA. 1.启动圆式 1.哄骗 service 启动:service mysqld start 2.哄骗 mysqld 脚本启动:/etc/inint.d/mysqld s ...

  8. python 搭建登陆系统,用Python连接操作MySQL数据库,做一个简单的用户登录注册系统...

    我们可以很容易地用Python实现一个用户登录系统,相信这即使是对编程新手来说也是小菜一碟. 作为Python的小萌新,今天我想记录下来的是如何实现一个连接了MySQL数据库的用户登录注册系统,它的效 ...

  9. 详解mysql数据库的启动与终止_详解MySQL数据库的启动与终止(一)

    由于MySQL服务器具有多种安装分发,而且能够运行在多种操作平台之上,因此它的启动与停止的方法也多种多样.你可以根据实际情况使用其中的一种.在你安装.升级或者维护系统时,你可能需要多次启动和终止服务器 ...

  10. 安装MySQL数据库无法启动服务的完美解决办法

    错误详细描述--安装好新的MYSLQ数据库后运行MySQL Server Instance Config Wizard,在最后一步出现无法启动服务错误,出现这样的提示"cannot crea ...

最新文章

  1. Entity Framework数据库初始化四种策略
  2. servlet监听完成统计在线人数,显示在线人员列表(附源码)
  3. 《Go语言圣经》学习笔记 第九章 基于共享变量的并发
  4. warning delete ·· (prettier/prettier)
  5. 常系数齐次线性递推学习笔记
  6. Android 12 将支持游戏“边下边玩”
  7. CentOS7 搭建基于DPDK的FD.io VPP环境-1
  8. Nginx源码编译及安装
  9. 汉诺塔C语言实现(纯代码)
  10. 贪吃蛇游戏设计预习01
  11. win软件 精品推荐磁力资源搜索助手 22.01.22中文特别版
  12. 基于stm32f401的双按键可视化多模式选择模块
  13. 机器学习-准确率、灵敏度、特异度、PPV、NPV、F1计算方法
  14. 希腊字母读音及其latex输入
  15. 五一放一天不调休,你能接受吗?
  16. 9.png图片的处理
  17. ai智能电话机器人语音识别技术
  18. 动态社区网络前沿研究
  19. python数据分析——pyecharts柱状图全解(小白必看)
  20. linux dns配置srv记录,一个关于MS AD + Bind DNS的棘手问题--SRV记录

热门文章

  1. php streamsocketenablecrypto,PHPMailer发送邮件报错Msg:stream_socket_enable_crypto():
  2. 【C++】set和multiset区别
  3. 服务器自动几点重启php,windows下apache及mysql定时自动重启服务器定时自动重启...
  4. 南京晓庄学院c语言试卷,南京晓庄学院—C语言期末考试复习提纲.doc
  5. 2014年计算机一级考试题目,2014年计算机一级考试WPS及基础模拟试题(2)
  6. 如何恢复隐藏的窗口 已知进程名称_Windows 10如何显示文件名后缀?
  7. python--元组:tuple
  8. Python零基础学习笔记(六)—— 变量和常量
  9. 详解Python中re.sub
  10. unity3d shader 自定义光照函数