title: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) . mysql.sock not exist in /var/lib/mysql/
body: <p>Magento Showing "There Has Been Error Processing Your Request "</p>
  
  <p>When trying to command " sudo service mysqld restart" but failed to Start</p>
  
  <p>Then See the Log Showing me " SQLSTATE[HY000] [2002] No such file or directory "</p>
  
  <p>I do Little search on Google, stackoverflow, magento stackoverflow sites and at last got something may be</p>
  
  <p>after the Command " mysqld -u root -p status"</p>
  
  <p>showing 'mysqladmin: connect to server at 'localhost' failed
  error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)'
  Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!</p>
  
  <p>I located that I don't have mysql.sock in /var/lib/mysql/ So now what I should do . I am not in expert just newbie . Unfortunately I gave 777 permission to all directory in ec2 instance, after some time of this Issue I see My site " There has been an error processing your request . for ec2 security reason I was not able to access instance using ftp or ssh . so I had to do create new instance gave this EBS to new instance , after changing permission I able to access my instance</p>
  
  <p>Please take a look at my my.cnf file. I am seeing something can help</p>
  
  <pre><code>[mysqld]
  datadir=/var/lib/mysql
  socket=/var/lib/mysql/mysql.sock
  # Disabling symbolic-links is recommended to prevent assorted security risks
  symbolic-links=0
  # Settings user and group are ignored when systemd is used.
  # If you need to run mysqld under a different user or group,
  # customize your systemd unit file for mysqld according to the
  # instructions in http://fedoraproject.org/wiki/Systemd
  
  [mysqld_safe]
  log-error=/var/log/mysqld.log
  pid-file=/var/run/mysqld/mysqld.pid
  </code></pre>
  
  <p>Here is The mysqld.log</p>
  
  <pre><code>/usr/libexec/mysql55/mysqld: Can't create/write to file '/tmp/ibmCz4dv'     (Errcode: 13)
  160212 18:29:37  InnoDB: Error: unable to create temporary file; errno: 13
  160212 18:29:37 [ERROR] Plugin 'InnoDB' init function returned error.
  160212 18:29:37 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE   failed.
  160212 18:29:37 [ERROR] Unknown/unsupported storage engine: InnoDB
  160212 18:29:37 [ERROR] Aborting
  160212 18:29:37 [Note] /usr/libexec/mysql55/mysqld: Shutdown complete
  160212 18:29:37 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
  </code></pre>
  
  <p>775 to /tmp and Now The mysqld.log</p>
  
  <p>775 to /tmp and mysqld.log</p>
  
  <pre><code>/usr/libexec/mysql55/mysqld: Can't create/write to file '/tmp/ibLzshr1' (Errcode: 13)
  160213  9:08:59  InnoDB: Error: unable to create temporary file; errno: 13
  160213  9:08:59 [ERROR] Plugin 'InnoDB' init function returned error.
  160213  9:08:59 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
  160213  9:08:59 [ERROR] Unknown/unsupported storage engine: InnoDB
  160213  9:08:59 [ERROR] Aborting
  
  160213  9:08:59 [Note] /usr/libexec/mysql55/mysqld: Shutdown complete
  
  160213 09:08:59 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
  </code></pre>
  
  <p>Please help me to Sort it out</p>