Framework: Laravel Spark : Cannot running "php artisan: migrate"

Created on 25 Mar 2018  路  1Comment  路  Source: laravel/framework

Hello everyone,

I'm desperate to finish installing Spark.

I have an error when I write the command "php artisan: migrate".
I have this error while my database exists and I can access it with another laravel project ...

It's been 2 hours I'm looking for no answer

Illuminate\Database\QueryException  : SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from information_schema.tables where table_schema = api-bbk and table_name = migrations)

  at /Users/amartineau/Documents/Sites/api-bbk/vendor/laravel/framework/src/Illuminate/Database/Connection.php:664
    660|         // If an exception occurs when attempting to run a query, we'll format the error
    661|         // message to include the bindings with SQL, which will make this exception a
    662|         // lot more helpful to the developer instead of just the database's errors.
    663|         catch (Exception $e) {
  > 664|             throw new QueryException(
    665|                 $query, $this->prepareBindings($bindings), $e
    666|             );
    667|         }
    668| 

  Exception trace:

  1   PDOException::("SQLSTATE[HY000] [2002] No such file or directory")
      /Users/xxx/Documents/Sites/api-bbk/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:68

  2   PDO::__construct("mysql:host=localhost;port=3306;dbname=api-bbk", "root", "root", [])
      /Users/xxx/Documents/Sites/api-bbk/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:68

And this is my .en file :

DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=api-bbk
DB_USERNAME=root
DB_PASSWORD=root

Do you have any solution for this problem?

Thank you in advance

Most helpful comment

I found a solution.
As I'm on MAMP, I had to specify the socket
'unix_socket' => '/Applications/MAMP/tmp/mysql/mysql.sock',

>All comments

I found a solution.
As I'm on MAMP, I had to specify the socket
'unix_socket' => '/Applications/MAMP/tmp/mysql/mysql.sock',

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fideloper picture fideloper  路  3Comments

iivanov2 picture iivanov2  路  3Comments

felixsanz picture felixsanz  路  3Comments

PhiloNL picture PhiloNL  路  3Comments

SachinAgarwal1337 picture SachinAgarwal1337  路  3Comments