[英]Mac: Cannot connect to SQL server through Docker
I have an application which uses LocalDB and runs fine on a Windows PC, however I am trying to run this through my mac.... I'm struggling with connecting the application to a mySQL server which sits on docker.我有一个使用 LocalDB 并在 Windows PC 上运行良好的应用程序,但是我试图通过我的 mac 运行它.... I have been following the other guides such as ( https://docs.microsoft.com/en-us/sql/linux/quickstart-install-connect-docker?view=sql-server-ver15&pivots=cs1-bash ) related to this topic with no luck...
我一直在关注其他指南,例如( https://docs.microsoft.com/en-us/sql/linux/quickstart-install-connect-docker?view=sql-server-ver15&pivots=cs1-bash )与这个话题没有运气...
Here's what I've done so far, through terminal:到目前为止,这是我通过终端所做的:
sudo docker pull mcr.microsoft.com/mssql/server:2019-CU5-ubuntu-18.04须藤 docker 拉 mcr.microsoft.com/mssql/server:2019-CU5-ubuntu-18.04
sudo docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=<MyPassword123!>" sudo docker 运行 -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=<MyPassword123!>"
-p 1433:1433 --name sql_container -p 1433:1433 --name sql_container
-d mcr.microsoft.com/mssql/server:2019-CU5-ubuntu-18.04 -d mcr.microsoft.com/mssql/server:2019-CU5-ubuntu-18.04
Verified this is running by using sudo docker ps -a使用sudo docker ps -a验证这是在运行
Also verified by using Kitematic, container seems to be running well也通过使用 Kitematic 验证,容器似乎运行良好
MySQL looks well set-up in System Preferences MySQL 在系统偏好设置中看起来设置得很好
I'm not sure where to go from here... any help to get this working would be greatly appreciated!我不确定从这里到 go 的位置......任何帮助来完成这项工作将不胜感激!
As trivial as it was, the correct syntax to make this work is Server=XXX.XXX.X.XX,1433尽管它很简单,但使这项工作的正确语法是 Server=XXX.XXX.X.XX,1433
DO NOT INCLUDE PARENTHESES AND NO SPACE BETWEEN IP AND PORT IP 和 PORT 之间不包括括号并且没有空格
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.