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
I found a solution.
As I'm on MAMP, I had to specify the socket
'unix_socket' => '/Applications/MAMP/tmp/mysql/mysql.sock',
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',