title: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")
body: <p><strong>i cant open  mysql in ubuntu 16.04</strong>
  when i type mysql in my terminal </p>
  
  <pre><code>ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")
  </code></pre>
  
  <p>this show up
  and i try mysqld and its give me this ...</p>
  
  <p>the code error</p>
  
  <pre><code>    Failed to start mysqld.service: Unit mysqld.service not found.
  mhadi@mhadi:~/Desktop$ service mysql start
  Failed to start mysql.service: Unit mysql.service not found.
  mhadi@mhadi:~/Desktop$ sudo mysqld start
  170719 14:33:01 [Note] mysqld (mysqld 10.0.24-MariaDB-7) starting as process 14463 ...
  170719 14:33:01 [Warning] Can't create test file /var/lib/mysql/mhadi.lower-test
  mysqld: Can't change dir to '/var/lib/mysql/' (Errcode: 2 "No such file or directory")
  170719 14:33:01 [ERROR] Aborting
  
  170719 14:33:01 [Note] mysqld: Shutdown complete
  </code></pre>