Tuesday 27 March 2018

First impressions: SQL on Linux (Part 2)

In part 1, I explained the process on setting up SQL Server on an Ubuntu VM. I was able to access the server on local VM through Sqlcmd. However it does not give a great GUI experience.

In case you have a Windows machine on the same network, you can enjoy GUI experience of SSMS or Visual Studio or any other SQL Server management tool that you have been using in the past. In order to achieve that you will have to enabling access through port 1433 (default port used by SQL Server) on the client and server machine.

How to enable port 1433 on Ubuntu VM

Well, it turns out that it is not that difficult. Ubuntu comes with a default firewall (UFW - Uncomplicated Firewall). I referred this link to enable the firewall and then add an exception rule to allow inbound requests on port 1433.


Once it is set up, you need to find the IP of the Ubuntu machine. It is simple too. Open system settings.


Select network settings.


Once you have the IP address, you can connect from windows machine. I used Visual Studio SQL Server Object Explorer to connect to the server.


Awesome!!


First impressions: SQL on Linux (Part 1)

First impressions of installing and running SQL Server on a UNIX distribution (Ubuntu in this case) for a always-have-been-a-windows-use : better than a dream. You can have same one of the most loved and easy-to-use RDBMS SQL Server on a non-windows environment with no change in capabilities as far as OLTP workloads are considered. OLAP workloads do not map right now but i am sure Microsoft would be thinking of that as next logical step. Just so you know, almost everything that i tried works identically on Windows and Linux. 

Installation and configuration was a breeze. You get a nice unix style console based configuration flow to choose the SKU ( i chose developer edition), configure SA password, select language etc.




Once it configured, it is already up and running. I was happy to notice that it running just fine on a 4 GB RAM, 2 V-CPU hyper-V VM.

How do you access it? Well there is no unix version of SQL Server management studio yet. So you have 2 options.

1. Use SQLCMD. It is not all that difficult to get used to.



2. Have a windows machine connect to your linux sql server through SSMS or Visual Studio :).