mysql没有写log_小记一次mysql启动失败没有日志的处理

本来mysql好的,之前清理了一次tmp下的东西,mysql在查询的时候提示:

Can‘t create/write to file‘/tmp/ib0n3frL

然后停止启动:

[root@sevck_linux mysql]# service mysqld start

MySQL Daemon failed to start.

Starting mysqld: [FAILED]

启动失败了,看一下日志,发现配置的时候没添加日志配置

查找my.cnf,在[mysqld]下添加log-error=/var/log/mysql/mysql-error.log

配置mysql的错误日志,mysql目录自行设置,其中记住一点,chown -R mysql:mysql /tmp/mysql

赋予mysql目录权限,因为我是root, mysql运行权限为mysql,没有权限

再启动mysql尝试:

180222 10:45:28InnoDB: Mutexes and rw_locks use GCC atomic builtins180222 10:45:28 InnoDB: Compressed tables use zlib 1.2.3

180222 10:45:28InnoDB: Using Linux native AIO^G/usr/libexec/mysqld: Can‘t create/write to file‘/tmp/mysql_data/ibAGn543‘(Errcode: 13)

180222 10:45:28 InnoDB: Error: unable to create temporary file; errno: 13

180222 10:45:28 [ERROR] Plugin ‘InnoDB‘init function returned error.180222 10:45:28 [ERROR] Plugin ‘InnoDB‘ registration asa STORAGE ENGINE failed.180222 10:45:28 [ERROR] Unknown/unsupported storage engine: InnoDB180222 10:45:28[ERROR] Aborting180222 10:45:28 [Note] /usr/libexec/mysqld: Shutdown complete

原来是Can‘t create/write to file,那么就好解决了,看看mysql_data目录是否存在。

chmod  -R 777 /tmp

赋予写的权限,启动mysql:

root@sevck_linux mysql]# service mysqld start

Starting mysqld: [ OK ]

just do it.

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值