本文介绍了pid文件/var/run/mysqld/mysqld.pid中的mysqld_safe mysqld阻止服务器重新启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在CentOS上的mySQL服务器已正常运行,但是,我今天无法突然重新启动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

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

显示[失败]

2)查看日志

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

3)手动放置

 /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)检查配置

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)检查mysql目录,每个所有者都属于mysql.但是我不能对mysql.sock进行罚款(这是在my.cnf中设置的)

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)我发现/var/lib/mysql目录中没有mysql.sock,然后出于测试目的尝试此操作.

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

尝试重新启动

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

以某种方式删除了mysql.sock.

somehow mysql.sock is deleted.

还有其他可以尝试的东西吗?

Is there any other things I can try??

推荐答案

我在Google周围搜索并尝试.

I googled around and try.

对我有用.谢谢.

这篇关于pid文件/var/run/mysqld/mysqld.pid中的mysqld_safe mysqld阻止服务器重新启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-10 05:07