title: mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid prevent from server restart
body: <p>My mySQL server on CentOS has been working correctly,
  but, I am unable to restart mysqld suddenly today.</p>
  
  <p>1)
      # /etc/rc.d/init.d/mysqld start</p>
  
  <p>shows [failed]</p>
  
  <p>2) see the log </p>
  
  <pre><code>tail /var/log/mysqld.log 
  .
  .
  mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
  </code></pre>
  
  <p>3) manually put</p>
  
  <pre><code> /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
  </code></pre>
  
  <p>4)check config</p>
  
  <pre><code>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
  </code></pre>
  
  <p>5)check mysql directory,every owner ship is belonging to mysql. However I can't fine mysql.sock (this is set in my.cnf)</p>
  
  <pre><code>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
  </code></pre>
  
  <p>6) I found there is no mysql.sock in /var/lib/mysql directory, then I try this for test purpose.</p>
  
  <pre><code>touch /var/lib/mysql/mysql.sock
  </code></pre>
  
  <p>try to restart </p>
  
  <pre><code>/etc/rc.d/init.d/mysqld start
  </code></pre>
  
  <p>somehow mysql.sock is deleted.</p>
  
  <p>Is there any other things I can try??</p>