Closed h1meS closed 1 year ago
So I did add network_mode: host reference to both services for localhost usage but now I'm getting another error:
I try to add CMD ["sqlcmd -S localhost -U SA -P 'Un!q@to2023' -C"]
command to dockerfile but it didnt work.
I also learned that there is a parameter for config file which is TrustServerCertificate=yes
but I couldnt figure out where to put it.
I manage to add TrustServerCertificate=true
for pdo connection but it leeds me to another error this time:
This seems like the server doesn't have a database "db_name", rather than an issue with the driver. What happens if you don't specify the database?
Yes I realize that and fixed now It's working and I can connect to through php script Thx.
Hello @h1meS im running through the same problem can you explain what steps you took to make it work
Working on a task with 2 containers(each build with Dockerfile) and compose file, try to test connection with php script but throws the error on title. I'm using vagrant for VM (Ubuntu 20.04)
First Container (sqlsrvr)
Second Container (php-apache)
Compose file
My php script for test
After the initial startup everything seems ok and running looking on the logs. I can connect to database with docker exec with my password . I can access into index.php page through apache and confirm drivers are working. But switching to DbTest.php gets the error.
So far I try these and still no solution:
links: - "db:localhost"
.