Laravel homestead Vagrant: ERROR 2002 (HY000): Can't connect to local MySQL server through socket
<p>I set up Laravel HomeStead due do documentation here <a href="https://laravel.com/docs/5.2/homestead" rel="nofollow noreferrer">https://laravel.com/docs/5.2/homestead</a></p>
<p>After commands</p>
<blockquote>
<p>vagrant up</p>
<p>vagrant ssh</p>
</blockquote>
<p>My sites works correctly and I can connect to mysql (MariaDB) with default username/password</p>
<blockquote>
<p>mysql -uroot -psecret</p>
</blockquote>
<p>without problem. But unfortunately my happiness is not long because after 5 mins since moment of initialization vagrant (vagrant up) connection to mysql has been lost and I got error on attempt of connection to mysql from console</p>
<blockquote>
<p>vagrant@homestead:~$ mysql -uroot -psecret</p>
<p>ERROR 2002 (HY000): Can't
connect to local MySQL server through socket
'/var/run/mysqld/mysqld.sock' (2 &quot;No such file or directory&quot;)</p>
</blockquote>
<p>As a result file /var/run/mysqld/mysqld.sock is disappeared though it has been there at once after initialization (vagrant up)</p>
<p>If say all shortly:
<em><strong>Everything works nice for 5 mins then connection to mysql is lost (</strong></em></p>
<p>Could someone help me to resolve this issue ?</p>
<p>Thanks in advance,</p>
<p>Yevgenii</p>