Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Setting up Laravel on a Mac php artisan migrate error: No such file or directory

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 910
    Comment on it

    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)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: