var run mysql mysqld,pid文件/var/run/mysqld/mysqld.pid中的mysqld_safe mysqld阻止服务器重新启动...

My mySQL server on CentOS has been working correctly,

but, I am unable to restart mysqld suddenly today.

1)

# /etc/rc.d/init.d/mysqld start

shows [failed]

2) see the log

tail /var/log/mysqld.log

.

.

mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

3) manually put

/usr/bin/mysqld_safe

151129 15:54:36 mysqld_safe Logging to '/var/log/mysqld.log'.

151129 15:54:37 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql

151129 15:54:37 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

4)check config

less /etc/my.cnf

datadir=/var/lib/mysql

socket=/var/lib/mysql/mysql.sock

# Disabling symbolic-links is recommended to prevent assorted security risks

symbolic-links=0

# Recommended in standard MySQL setup

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

[mysqld_safe]

log-error=/var/log/mysqld.log

pid-file=/var/run/mysqld/mysqld.pid

5)check mysql directory,every owner ship is belonging to mysql. However I can't fine mysql.sock (this is set in my.cnf)

cd /var/lib/mysql

ls -la

drwxr-xr-x 5 mysql mysql 4096 11月 29 15:54 2015 .

drwxr-xr-x 21 root root 4096 6月 2 06:09 2015 ..

-rw-rw---- 1 mysql mysql 56 6月 2 05:42 2015 auto.cnf

drwx------ 2 mysql mysql 4096 11月 24 11:12 2015 myapp

-rw-rw---- 1 mysql mysql 50331648 11月 29 12:30 2015 ib_logfile0

-rw-rw---- 1 mysql mysql 50331648 11月 29 12:30 2015 ib_logfile1

-rw-rw---- 1 mysql mysql 79691776 11月 29 12:30 2015 ibdata1

drwx------ 2 mysql mysql 4096 6月 2 05:42 2015 mysql

drwx------ 2 mysql mysql 4096 6月 2 05:42 2015 performance_schema

6) I found there is no mysql.sock in /var/lib/mysql directory, then I try this for test purpose.

touch /var/lib/mysql/mysql.sock

try to restart

/etc/rc.d/init.d/mysqld start

somehow mysql.sock is deleted.

Is there any other things I can try??

解决方案

I googled around and try.

restorecon -r /var/lib/mysql

it works for me.

Thanks.

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值