3
votes

I'm new to laravel and I'm exploring how to do migrations. I created a new users table and when I run "php artisan migrate" it gives me "[PDOException] SQLSTATE[HY000] [2002] No connection could be made because the target machine actively refused it." . I run "composer dump-autoload" then did "composer install" but no joy. I configured my .env file like below:


DB_CONNECTION=mysql

DB_HOST=127.0.0.1

DB_PORT=3306

DB_DATABASE=francis

DB_USERNAME=homestead

DB_PASSWORD=secret


Mysql status: enter image description here

1
Make sure that your mysql is working!Saumya Rastogi
wait I'll try that.claudios
I tried but not workingclaudios
Make your mysql work, then it would work as a charmSaumya Rastogi
@SaumyaRastogi, any way we can test if mysql is working or not?claudios

1 Answers

0
votes

I think MySql service is not active. You have to active MySQL service. Because it's unable to connect with DB. Or I think disable proxy at web.config file try this.

<system.net>
  <defaultProxy> 
    <proxy usesystemdefault="False"/> 
  </defaultProxy>
</system.net>