1

1) i make authentication through php artisan make:auth 2) Now i want to migrate user table to SQL servel php artisan migrate

it show this error

SQLSTATE[08001]: [Microsoft][ODBC Driver 17 for SQL Server]TCP Provider: No connection could be made because the target machine actively refused it. (SQL: select * from sysobjects where type = 'U' and name = migrations)

.env file

DB_CONNECTION=sqlsrv
DB_HOST=DESKTOP-4DE9LKC\SQLEXPRESS
DB_PORT=1433
DB_DATABASE=mah
DB_USERNAME=
DB_PASSWORD=

database file

'default' => env('DB_CONNECTION', 'sqlsrv'),
'connections' => [
        'sqlsrv' => [
            'driver' => 'sqlsrv',
            'url' => env('DATABASE_URL'),
            'host' => env('DB_HOST', 'DESKTOP-4DE9LKC\SQLEXPRESS'),
            'port' => env('DB_PORT', '1433'),
            'database' => env('DB_DATABASE', 'mah'),
            'username' => env('DB_USERNAME', ''),
            'password' => env('DB_PASSWORD', ''),
            'charset' => 'utf8',
            'prefix' => '',
            'prefix_indexes' => true,
        ],
    ],

I expect the output table are create in sql server

1 Answer 1

1

The SQL Server does not allow you to connect. Either the credentials are wrong or a firewall is blocking the connection to port 1433 on the target machine.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks Sir, its really helpful

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.