I have all code in github and my project is running properly in Ubuntu system . I want to run and set up my Laravel project on a Mac and I am getting error "No such file or directory" when we write the command
php artisan migrate
And I have added these 3 lines in php.ini
mysql.default_socket = /var/run/mysqld/mysqld.sock
mysqli.default_socket = /var/run/mysqld/mysqld.sock
pdo_mysql.default_socket = /var/run/mysqld/mysqld.sock
So to overcome that Problem I have added the keyword unix _socket with the value of path that the mysql.sock resides in MAMP.
Note: To use this code there is necessary that you are using MAMP.
'mysql' => array(
'driver' => 'mysql',
'host' => 'localhost',
'unix_socket' => '/Applications/MAMP/tmp/mysql/mysql.sock',
'database' => 'database',
'username' => 'root',
'password' => 'root',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
),
By defining this we can solve that issue.
0 Comment(s)