title: MySQL starting error (Can't start server: can't create PID file: No such fie or directory)
body: <p>I'm having trouble starting <code>mysql</code> and <code>mysqld</code>.</p>
  
  <p>Output of <code>sudo service mysql start</code> command is <code>mysql : Unrecognized service</code></p>
  
  <p>Same way output of <code>sudo service mysqld start</code> is nothing</p>
  
  <p>When I tried <code>sudo service mysqld status</code> it says <code>stopped</code></p>
  
  <p>Note: I'm using rhel 6.5
  MySQL version is mysqld  Ver 5.6.21-ndb-7.3.7-cluster-gpl for linux-glibc2.5 on x86_64 (MySQL Cluster Community Server (GPL))</p>
  
  <p>I went through <code>/var/log/mysql.log</code> found this error :</p>
  
  <pre><code>2015-10-20 08:00:54 23694 [Note] InnoDB: 128 rollback segment(s) are active.
  2015-10-20 08:00:54 23694 [Note] InnoDB: Waiting for purge to start
  2015-10-20 08:00:54 23694 [Note] InnoDB: 5.6.21 started; log sequence number 1600607
  2015-10-20 08:00:54 23694 [Note] Server hostname (bind-address): '*'; port: 3306
  2015-10-20 08:00:54 23694 [Note] IPv6 is available.
  2015-10-20 08:00:54 23694 [Note]   - '::' resolves to '::';
  2015-10-20 08:00:54 23694 [Note] Server socket created on IP: '::'.
  2015-10-20 08:00:54 23694 [ERROR] /usr/local/mysql/bin/mysqld: Can't create/write to fie '/var/run/mysqld/mysqld.pid' (Errcode: 2 - No such file or directory)
  2015-10-20 08:00:54 23694 [ERROR] Can't start server: can't create PID file: No such fie or directory
  151020 08:00:54 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
  </code></pre>
  
  <p>For which I looked online and tried to fix issue which said to be of the permission, So I created to fix this error which <code>/var/run/mysqld</code> for <code>mysql.pid</code> and I did <code>chown</code> the directory to <code>mysql:mysql</code></p>
  
  <p>But still the problem persist.
  Can anyone help me out with this!</p>
  
  <p>Thanks</p>
  
  <p>Permissions of data directory <code>/var/lib/mysql</code> :</p>
  
  <pre><code>drwxr-xr-x.  2 mysql root      4096 Oct 20 08:00 .
  drwxr-xr-x. 33 root  root      4096 Oct 20 08:00 ..
  -rwxr-xr-x.  1 mysql mysql       56 Oct 20 08:00 auto.cnf
  -rwxr-xr-x.  1 mysql mysql 12582912 Oct 20 08:00 ibdata1
  -rwxr-xr-x.  1 mysql mysql 50331648 Oct 20 08:00 ib_logfile0
  -rwxr-xr-x.  1 mysql mysql 50331648 Oct 20 08:00 ib_logfile1
  srwxr-xr-x.  1 mysql mysql        0 Oct 20 08:00 mysql.sock
  </code></pre>
  
  <p>Output for <code>ps aux | grep mysql</code> :</p>
  
  <pre><code>ec2-user 19246  0.0  0.0 103256   832 pts/2    S+   16:39   0:00 grep mysql
  ec2-user 31724  0.0  0.0 127088  3740 pts/0    S+   Jan22   0:00 mysql -u root -p
  </code></pre>
  
  <p>Output for <code>sudo rpm -qa | egrep -i mysql</code></p>
  
  <pre><code>perl-DBD-MySQL-4.013-3.el6.x86_64
  mysql-community-server-5.6.27-2.el6.x86_64
  mysql-community-release-el6-5.noarch
  mysql-community-common-5.6.27-2.el6.x86_64
  mysql-community-client-5.6.27-2.el6.x86_64
  mysql-community-libs-compat-5.6.27-2.el6.x86_64
  mysql-community-libs-5.6.27-2.el6.x86_64
  </code></pre>