Check out example codes for "Illuminate\Database\QueryExceptionSQLSTATE[HY000] [2002] No such file or directory". It will help you in understanding the concepts better.

Code Example 1

Add mysql.sock path in database.php file

Code Example 2

Make sure your config/database.php is the default config for database

Learn ReactJs, React Native from akashmittal.com