andrehendrata

andrehendrata

Member Since 4 Weeks Ago

Experience Points
150
Total
Experience

4,850 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed
0
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start your engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-in-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

Level 1
150 XP
Sep
21
4 weeks ago
Activity icon

Replied to Cannot Connect To Mssql (laradock)

finally

[email protected]:/var/www# php artisan migrate
Migration table created successfully.
Migrating: 2014_10_12_000000_create_users_table
Migrated:  2014_10_12_000000_create_users_table (11.55ms)
Migrating: 2014_10_12_100000_create_password_resets_table
Migrated:  2014_10_12_100000_create_password_resets_table (3.60ms)
Migrating: 2019_08_19_000000_create_failed_jobs_table
Migrated:  2019_08_19_000000_create_failed_jobs_table (4.95ms)
[email protected]:/var/www#

thanks man!!

so the problem there was no alliases name on the network

Activity icon

Replied to Cannot Connect To Mssql (laradock)

config/database.php

'sqlsrv' => [
            'driver' => 'sqlsrv',
            'url' => env('DATABASE_URL'),
            'host' => env('DB_HOST', 'localhost'),
            'port' => env('DB_PORT', '1433'),
            'database' => env('DB_DATABASE', 'forge'),
            'username' => env('DB_USERNAME', 'forge'),
            'password' => env('DB_PASSWORD', ''),
            'charset' => 'utf8',
            'prefix' => '',
            'prefix_indexes' => true,
        ],

env file

DB_CONNECTION=sqlsrv
DB_HOST=localhost
DB_PORT=1433
DB_DATABASE=laravelsql
DB_USERNAME=sa
[email protected]

laradock env file

### MSSQL #################################################

MSSQL_DATABASE=laravelsql
[email protected]				
MSSQL_PORT=1433

mssql dockerfile:

FROM mcr.microsoft.com/mssql/server:2017-latest-ubuntu

ENV MSSQL_PID=Express
ENV MSSQL_DATABASE=laravelsql
ENV ACCEPT_EULA=Y
ENV [email protected]


EXPOSE 1433
Activity icon

Replied to Cannot Connect To Mssql (laradock)

rebuilt with aliases but still has same error when trying php artisan migrate

[email protected]:/var/www# php artisan migrate

   Illuminate\Database\QueryException 

  SQLSTATE[HYT00]: [Microsoft][ODBC Driver 17 for SQL Server]Login timeout expired (SQL: select * from sysobjects where type = 'U' and name = migrations)

  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

new latest mssql inspect network

 "NetworkSettings": {
            "Bridge": "",
            "SandboxID": "ff7fcb64cd82e43dd74d468228ae6b0bbaee55d682ad51487d900b94a157badb",
            "HairpinMode": false,
            "LinkLocalIPv6Address": "",
            "LinkLocalIPv6PrefixLen": 0,
            "Ports": {
                "1433/tcp": [
                    {
                        "HostIp": "0.0.0.0",
                        "HostPort": "1433"
                    }
                ]
            },
            "SandboxKey": "/var/run/docker/netns/ff7fcb64cd82",
            "SecondaryIPAddresses": null,
            "SecondaryIPv6Addresses": null,
            "EndpointID": "",
            "Gateway": "",
            "GlobalIPv6Address": "",
            "GlobalIPv6PrefixLen": 0,
            "IPAddress": "",
            "IPPrefixLen": 0,
            "IPv6Gateway": "",
            "MacAddress": "",
            "Networks": {
                "laradock_backend": {
                    "IPAMConfig": null,
                    "Links": null,
                    "Aliases": [
                        "mssql",
                        "86ffda17f6d8"
                    ],
                    "NetworkID": "17f647ba515eb4d0fe6b20d28c8eabb8700c29b70c74476987cf82c473098cf5",
                    "EndpointID": "50781183da7a9ab5844696296a510550e35012f77998e3a177c9667980757554",
                    "Gateway": "172.19.0.1",
                    "IPAddress": "172.19.0.3",
                    "IPPrefixLen": 16,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "MacAddress": "02:42:ac:13:00:03",
                    "DriverOpts": null
                }
            }
Activity icon

Replied to Cannot Connect To Mssql (laradock)

my docker-compose.yml mssql part

### MSSQL ################################################
    mssql:
      build:
        context: ./mssql
      environment:
        - MSSQL_PID=Express
        - MSSQL_DATABASE=laravelsql
        - [email protected]
        - ACCEPT_EULA=Y
      volumes:
        - ${DATA_PATH_HOST}/mssql:/var/opt/mssql/data
      ports:
        - "${MSSQL_PORT}:1433"
      networks:
        - backend
Activity icon

Replied to Cannot Connect To Mssql (laradock)

i did put the connection into the network on all installed laradock (nginx, mssql, php-fpm etc ) Image

I'm using kitematic to check docker network

Activity icon

Replied to Cannot Connect To Mssql (laradock)

i did clear the cache using php artisan config:clear

i don't understand dd(config("database.connections.sqlsrv.host")); run that on command line?

Activity icon

Replied to Cannot Connect To Mssql (laradock)

this is my mssql inspect result

C:\Users\andre>docker inspect a5f1
[
    {
        "Id": "a5f146781bc61e44c897f103a0d46062e796df4f6007bb8399e7a10ed30cda11",
        "Created": "2020-09-18T02:59:58.504451374Z",
        "Path": "/opt/mssql/bin/nonroot_msg.sh",
        "Args": [
            "/opt/mssql/bin/sqlservr"
        ],
        "State": {
            "Status": "running",
            "Running": true,
            "Paused": false,
            "Restarting": false,
            "OOMKilled": false,
            "Dead": false,
            "Pid": 1825,
            "ExitCode": 0,
            "Error": "",
            "StartedAt": "2020-09-21T02:59:01.780369866Z",
            "FinishedAt": "2020-09-19T01:28:50.847099887Z"
        },
        "Image": "sha256:32949a4015fcad0b4dc7418430fc6a492aa506bff1f8ded662d00dc95d0a1164",
        "ResolvConfPath": "/var/lib/docker/containers/a5f146781bc61e44c897f103a0d46062e796df4f6007bb8399e7a10ed30cda11/resolv.conf",
        "HostnamePath": "/var/lib/docker/containers/a5f146781bc61e44c897f103a0d46062e796df4f6007bb8399e7a10ed30cda11/hostname",
        "HostsPath": "/var/lib/docker/containers/a5f146781bc61e44c897f103a0d46062e796df4f6007bb8399e7a10ed30cda11/hosts",
        "LogPath": "/var/lib/docker/containers/a5f146781bc61e44c897f103a0d46062e796df4f6007bb8399e7a10ed30cda11/a5f146781bc61e44c897f103a0d46062e796df4f6007bb8399e7a10ed30cda11-json.log",
        "Name": "/laradock_mssql_1",
        "RestartCount": 0,
        "Driver": "overlay2",
        "Platform": "linux",
        "MountLabel": "",
        "ProcessLabel": "",
        "AppArmorProfile": "",
        "ExecIDs": null,
        "HostConfig": {
            "Binds": [
                "/host_mnt/c/Users/andre/.laradock/data/mssql:/var/opt/mssql/data:rw"
            ],
            "ContainerIDFile": "",
            "LogConfig": {
                "Type": "json-file",
                "Config": {}
            },
            "NetworkMode": "laradock_backend",
            "PortBindings": {
                "1433/tcp": [
                    {
                        "HostIp": "",
                        "HostPort": "1433"
                    }
                ]
            },
            "RestartPolicy": {
                "Name": "no",
                "MaximumRetryCount": 0
            },
            "AutoRemove": false,
            "VolumeDriver": "",
            "VolumesFrom": [],
            "CapAdd": null,
            "CapDrop": null,
            "Capabilities": null,
            "Dns": [],
            "DnsOptions": [],
            "DnsSearch": [],
            "ExtraHosts": null,
            "GroupAdd": null,
            "IpcMode": "shareable",
            "Cgroup": "",
            "Links": null,
            "OomScoreAdj": 0,
            "PidMode": "",
            "Privileged": true,
            "PublishAllPorts": false,
            "ReadonlyRootfs": false,
            "SecurityOpt": [
                "label=disable"
            ],
            "UTSMode": "",
            "UsernsMode": "",
            "ShmSize": 67108864,
            "Runtime": "runc",
            "ConsoleSize": [
                0,
                0
            ],
            "Isolation": "",
            "CpuShares": 0,
            "Memory": 0,
            "NanoCpus": 0,
            "CgroupParent": "",
            "BlkioWeight": 0,
            "BlkioWeightDevice": null,
            "BlkioDeviceReadBps": null,
            "BlkioDeviceWriteBps": null,
            "BlkioDeviceReadIOps": null,
            "BlkioDeviceWriteIOps": null,
            "CpuPeriod": 0,
            "CpuQuota": 0,
            "CpuRealtimePeriod": 0,
            "CpuRealtimeRuntime": 0,
            "CpusetCpus": "",
            "CpusetMems": "",
            "Devices": null,
            "DeviceCgroupRules": null,
            "DeviceRequests": null,
            "KernelMemory": 0,
            "KernelMemoryTCP": 0,
            "MemoryReservation": 0,
            "MemorySwap": 0,
            "MemorySwappiness": null,
            "OomKillDisable": false,
            "PidsLimit": null,
            "Ulimits": null,
            "CpuCount": 0,
            "CpuPercent": 0,
            "IOMaximumIOps": 0,
            "IOMaximumBandwidth": 0,
            "MaskedPaths": [
                "/proc/asound",
                "/proc/acpi",
                "/proc/kcore",
                "/proc/keys",
                "/proc/latency_stats",
                "/proc/timer_list",
                "/proc/timer_stats",
                "/proc/sched_debug",
                "/proc/scsi",
                "/sys/firmware"
            ],
            "ReadonlyPaths": [
                "/proc/bus",
                "/proc/fs",
                "/proc/irq",
                "/proc/sys",
                "/proc/sysrq-trigger"
            ]
        },
        "GraphDriver": {
            "Data": {
                "LowerDir": "/var/lib/docker/overlay2/f1cba758def8b04f71017b5c9520c4f294d67e1a52abff4525322380afa32b99-init/diff:/var/lib/docker/overlay2/3f046f8ad1941852b02d38adb90dd92edc6c43553c6808cbaed0efdab5da12df/diff:/var/lib/docker/overlay2/1f9d67e9e61fb7d8c1eb5c1c432e199f7b9ce50cf54cf83007b5763790ece744/diff:/var/lib/docker/overlay2/fec5dc22ed6d97ee64bebc14bf9cd1731f83a9c0bd190f82d50de26e2021188d/diff:/var/lib/docker/overlay2/2fb053ba75fc5c1c752002913f5a4adf560c2ac41be9db785ecabcb9b5f9b026/diff:/var/lib/docker/overlay2/76b5438fb5f2b38feca4b08446217514925a0ec7267a34e3e6656c764e8f265a/diff:/var/lib/docker/overlay2/b82323ca0caacb435881e2753074deb5a3c5fca8e2fc35e2ef81ee60714ea300/diff:/var/lib/docker/overlay2/31df928d714adf63750e47fe2f71bfc01f88ffaebc37a2ccb23a01c5bad15d6c/diff:/var/lib/docker/overlay2/594abcff77b9345dec74ad1416a195ef4010b62377b76f9057d4f4b02fc3f6e0/diff:/var/lib/docker/overlay2/cb29ed25ffefd5b33eb798bfbe23e75fb88c539b1b8a064852f769b7cd5e100e/diff",
                "MergedDir": "/var/lib/docker/overlay2/f1cba758def8b04f71017b5c9520c4f294d67e1a52abff4525322380afa32b99/merged",
                "UpperDir": "/var/lib/docker/overlay2/f1cba758def8b04f71017b5c9520c4f294d67e1a52abff4525322380afa32b99/diff",
                "WorkDir": "/var/lib/docker/overlay2/f1cba758def8b04f71017b5c9520c4f294d67e1a52abff4525322380afa32b99/work"
            },
            "Name": "overlay2"
        },
        "Mounts": [
            {
                "Type": "bind",
                "Source": "/host_mnt/c/Users/andre/.laradock/data/mssql",
                "Destination": "/var/opt/mssql/data",
                "Mode": "rw",
                "RW": true,
                "Propagation": "rprivate"
            }
        ],
        "Config": {
            "Hostname": "746b2518cf09",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "ExposedPorts": {
                "1433/tcp": {}
            },
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "MSSQL_PID=Express",
                "MSSQL_DATABASE=laravelsql",
                "[email protected]",
                "ACCEPT_EULA=Y",
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "[email protected]"
            ],
            "Cmd": [
                "/opt/mssql/bin/sqlservr"
            ],
            "Image": "laradock_mssql",
            "Volumes": null,
            "WorkingDir": "",
            "Entrypoint": [
                "/opt/mssql/bin/nonroot_msg.sh"
            ],
            "OnBuild": null,
            "Labels": {
                "com.docker.compose.config-hash": "b8058e09f6b5d48fe2599ba7cfbc6a3e8c09924081c2fbd04a276c786d7cf43a",
                "com.docker.compose.container-number": "1",
                "com.docker.compose.oneoff": "False",
                "com.docker.compose.project": "laradock",
                "com.docker.compose.project.config_files": "docker-compose.yml",
                "com.docker.compose.project.working_dir": "C:\Andre\Docker\laravelDragonRunner\dragonRunnerLaravel\laradock",
                "com.docker.compose.service": "mssql",
                "com.docker.compose.version": "1.25.4",
                "com.microsoft.product": "Microsoft SQL Server",
                "com.microsoft.version": "14.0.3356.20",
                "vendor": "Microsoft"
            }
        },
        "NetworkSettings": {
            "Bridge": "",
            "SandboxID": "e0beb7f4a1f37d1b8d57c497820c45d62fbee9069b98228799240f55f65f6f63",
            "HairpinMode": false,
            "LinkLocalIPv6Address": "",
            "LinkLocalIPv6PrefixLen": 0,
            "Ports": {
                "1433/tcp": [
                    {
                        "HostIp": "0.0.0.0",
                        "HostPort": "1433"
                    }
                ]
            },
            "SandboxKey": "/var/run/docker/netns/e0beb7f4a1f3",
            "SecondaryIPAddresses": null,
            "SecondaryIPv6Addresses": null,
            "EndpointID": "80ae9def5c57bc16f68d8a32710cd6e3c70bc564d5bea67a02c39ae7cbd22960",
            "Gateway": "172.17.0.1",
            "GlobalIPv6Address": "",
            "GlobalIPv6PrefixLen": 0,
            "IPAddress": "172.17.0.2",
            "IPPrefixLen": 16,
            "IPv6Gateway": "",
            "MacAddress": "02:42:ac:11:00:02",
            "Networks": {
                "bridge": {
                    "IPAMConfig": null,
                    "Links": null,
                    "Aliases": null,
                    "NetworkID": "c5607311adeaa55d297a6a6df2038f233b5e80b40479d5f46f4dc2f5e4cb6a8f",
                    "EndpointID": "80ae9def5c57bc16f68d8a32710cd6e3c70bc564d5bea67a02c39ae7cbd22960",
                    "Gateway": "172.17.0.1",
                    "IPAddress": "172.17.0.2",
                    "IPPrefixLen": 16,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "MacAddress": "02:42:ac:11:00:02",
                    "DriverOpts": null
                },
                "laradock_backend": {
                    "IPAMConfig": null,
                    "Links": null,
                    "Aliases": [
                        "a5f146781bc6"
                    ],
                    "NetworkID": "17f647ba515eb4d0fe6b20d28c8eabb8700c29b70c74476987cf82c473098cf5",
                    "EndpointID": "6c74ebcab9e874c31d7760ac9d3980700c4d2a334a6c5c132dbba58b068d3281",
                    "Gateway": "172.19.0.1",
                    "IPAddress": "172.19.0.2",
                    "IPPrefixLen": 16,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "MacAddress": "02:42:ac:13:00:02",
                    "DriverOpts": null
                }
            }
        }
    }
]
Activity icon

Replied to Cannot Connect To Mssql (laradock)

this is my docker ps list

Image laradock nginx php-fpm mssql all still running

Activity icon

Replied to Cannot Connect To Mssql (laradock)

i have tried both DB_HOST=mssql or DB_HOST=localhost but still have same error

Activity icon

Started a new Conversation Cannot Connect To Mssql (laradock)

hi, im currently installing a laravel docker from laradock https://laradock.io/

I have already installed nginx, mssql, php-fpm on the docker using docker-compose up mssql nginx php-fpm but when trying to migrate dataabse using php artisan migrate, there is an error:

Illuminate\Database\QueryException

SQLSTATE[HYT00]: [Microsoft][ODBC Driver 17 for SQL Server]Login timeout expired (SQL: select * from sysobjects where type = 'U' and name = migrations)

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▕

my database laravel env

DB_CONNECTION=sqlsrv DB_HOST=mssql DB_PORT=1433 DB_DATABASE=laravelsql DB_USERNAME=sa [email protected]

i can connect to mssql docker using windows management studio and comand line sqlcmd with that username and password, but cannot do php artisan migrate

what is missing here