MySQL数据库启动失败问题的处理

MySQL数据库启动失败问题的处理【阿里云服务器CentOS7为例】

[root@iZbp106mxhd41bfj0bxhuhZ ~]# service mysqld start
Timeout error occurred trying to start MySQL Daemon.
Starting mysqld: [FAILED]

说明:
遇到MySQL数据库启动失败,千万不要急着进行“rm”或修改“my.cnf”之类的尝试,rm操作会删除数据库,非常危险,谨记!

操作思路:
打开/var/log/mysqld.log文件,可以清晰的查看到问题出现的各种原因,从而对症下药,比如我的错误是:
InnoDB: Error: auto-extending data file ./ibdata1 is of a different size
InnoDB: 320 pages (rounded down to MB) than specified in the .cnf file:
InnoDB: initial 640 pages, max 0 (relevant if non-zero) pages!
InnoDB: Could not open or create data files.
InnoDB: If you tried to add new data files, and it failed here,
InnoDB: you should now edit innodb_data_file_path in my.cnf back
InnoDB: to what it was, and remove the new ibdata files InnoDB created
InnoDB: in this failed attempt. InnoDB only wrote those files full of
InnoDB: zeros, but did not yet use them in any way. But be careful: do not
InnoDB: remove old data files which contain your precious data!
191220 10:21:33 [ERROR] Plugin ‘InnoDB’ init function returned error.
191220 10:21:33 [ERROR] Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed.
191220 10:21:33 [ERROR] /usr/libexec/mysqld: Error writing file ‘/var/run/mysqld/mysqld.pid’ (Errcode: 28)
191220 10:21:33 [ERROR] Can’t start server: can’t create PID file: No space left on device
191220 10:21:33 mysqld_safe Number of processes running now: 0
191220 10:21:33 mysqld_safe mysqld restarted
191220 10:21:34 [Warning] ‘–default-character-set’ is deprecated and will be removed in a future release. Please use ‘–character-set-server’ instead.
… …
第一行:InnoDB: Error: auto-extending data file ./ibdata1 is of a different size
说明服务器空间已满,备份并删除部分文件,如图片等

service mysqld start

即可启动成功。MySQL done!
谢谢!

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值