I installed an mssql server using docker container in an ubuntu EC2 as follows:
sudo docker run --name my_mssql -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=<mypassword>" -p 1433:1433 -v /home/ubuntu/db:/var/opt/mssql -d microsoft/mssql-server-linux
sudo netstat -lpnt |grep 1433
shows 1433 is listening
I can login the mssql server using username=sa and password=mypassword using SQLPRO for MSSQL – a database manager, I can then create a database from that manager.
However, if I operate the mssql server from the EC2 in which the mssql server is installed, using the below command,
mysql -h <EC2 IP> -P 1433 -u sa -p
and then provide the password, it just stuck there and finally stop connecting with error message:
ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 2
Why I cannot operate mssql server from the ubuntu EC2? How can I do that?