0

I installed fresh laravel and edited .env.

Added my MAMP host:127.0.0.1, database:"abc", username:root, password:root and it then tried run command: php artisan migrate --pretend

Its gives this error:

   Illuminate\Database\QueryException 

  SQLSTATE[HY000] [2002] Connection refused (SQL: select * from information_schema.tables where table_schema = abc and table_name = migrations and table_type = 'BASE TABLE')

  at vendor/laravel/framework/src/Illuminate/Database/Connection.php:671
    667|         // If an exception occurs when attempting to run a query, we'll format the error
    668|         // message to include the bindings with SQL, which will make this exception a
    669|         // lot more helpful to the developer instead of just the database's errors.
    670|         catch (Exception $e) {
  > 671|             throw new QueryException(
    672|                 $query, $this->prepareBindings($bindings), $e
    673|             );
    674|         }
    675| 

      +37 vendor frames 
  38  artisan:37
      Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

Tried change also mamp pro port to 8889 and same issue.

lpm29356
  • 13
  • 3
  • check your database.php file if you are using mysql, check if you have 'mysql' => [ // check here that you have keys for database, username, password, port, driver and host] – bhucho Aug 02 '20 at 21:05
  • try out this https://stackoverflow.com/questions/35394230/sqlstatehy000-2002-connection-refused-within-laravel-homestead – bhucho Aug 02 '20 at 21:07
  • I had to add unix_shocks for mamp pro and got working, thanks for trying to help. – lpm29356 Aug 03 '20 at 16:03

0 Answers0