YOu can Run MSSQL on Linux?
Thank you Microsoft I can stick with Linux for Longer;-)
And Cheaper.....
So Image likes are at https://hub.docker.com/_/microsoft-mssql-server
For MSSQL 2019 use:
Get the IMAGE
docker pull mcr.microsoft.com/mssql/server:2019-latest
Start the IMAGE
sudo docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=YOurPassword" -p 1433:1433 --name sql1 -d mcr.microsoft.com/mssql/server:2019-latest
Install MSSQL Tools
sudo yum install -y mssql-tools unixODBC-devel
For convenience, add /opt/mssql-tools/bin/ to your PATH environment variable
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
source ~/.bashrc
THat is it....
Connect with
sqlcmd -S localhost -U SA -P '<YourPassword>' or the Docker way
docker exec -it name/id /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P YourPassword
PS.. Remember to open the Firewall If you going to connect remotely
Step 1 : Pull MySql image from docker hub. Following command will pull the latest mysql image.
docker pull mysql
Step 2: Run a container from this image. ‘-name’ gives a name to the container. ‘ -e’ specifies run time variables you need to set. Set the password for the MySQL root user using ‘MYSQL_ROOT_PASSWORD’. ‘-d’ tells the docker to run the container in background.
docker run --name=testsql -e MYSQL_ROOT_PASSWORD=rukshani -d mysql
This will output a container id; which means that the container is running in the background properly.
Step 3: Then check the status of the container by issuing, ‘docker ps’ command
docker ps

Now you should be able to see that MySQL is running on port 3306.
Step 4: To checkout the logs of the running container use the following command
docker logs testsql
Step 5: Find the IP of the container using following. Check out the “IPAddress” from the output, this will tell you the ip address.
docker inspect testsql
Now you should be able to connect to MySQL using this ip address on port 3306.
Accessing MySQL through a Web Interface
phpMyAdmin gives us a web interface to access MySQL database and we are going to use that to access and administer MySQL database that we have set up earlier.
Step 1: Pull phpMyAdmin image from docker hub
docker pull phpmyadmin/phpmyadmin
Step 2: To link our existing MySQL container with phpMyAdmin application use the following.
docker run --name myadmin -d --link testsql:db -p 8080:80 phpmyadmin/phpmyadmin
That’s it! Now open up a browser and go to ‘http://localhost:8080/’.
Use the username as ‘root’ and give the password that you set earlier for ‘‘MYSQL_ROOT_PASSWORD’ and you should be able to login and manage your mysql database through phpMyAdmin.
