title: how to reset my mysql password in mac os 10.13.3
body: <p>I have a problem with MySQL. I forgot the password I used when I installed it
  so, I can not access to the server now. 
  I tried deleting the MySQL and install it again but it didn't show the password again.
  So I tried to do it by the terminal and this is the result ...
  first i stopped the MySQL server
  <a href="https://i.stack.imgur.com/eWvrD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eWvrD.png" alt="first"></a></p>
  
  <p>then i put <code>sudo /usr/local/mysql/bin/mysqld_safe –skip-grant-tables</code> in the terminal</p>
  
  <p><a href="https://i.stack.imgur.com/oQT1K.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oQT1K.png" alt="second"></a></p>
  
  <p>after that in new terminal window i wrote <code>sudo /usr/local/mysql/bin/mysql -u root
  UPDATE mysql.user SET Password=PASSWORD('root') WHERE User='root';
  FLUSH PRIVILEGES;
  \q</code></p>
  
  <p>the result was "ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)"</p>
  
  <p><a href="https://i.stack.imgur.com/dfUb1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dfUb1.png" alt="third"></a></p>
  
  <p>these are all the commands</p>
  
  <p><a href="https://i.stack.imgur.com/cMrfG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cMrfG.png" alt="fourth"></a></p>