One of most interesting things last year was release of MS SQL Server for Linux. Like I said in some of my posts before, I wouldn’t have dreamt of it 5-6 years ago. But things changed very much in last few years and this is another big step Microsoft took toward OpenSource community. In this post I will take you through setting up SQL on Linux VM on Azure. First few steps will be specific to setting up environment in Azure portal but later steps can be used on local server or local VM running Linux. I simply use Azure for setting up new VM as I don’t want to waste resources on my laptop.
So first go to Azure portal and set up your Linux VM. Go to portal, click new, select ‘Compute’ and select ‘Ubuntu Server’.
Select ‘Resource Manager’ and click ‘Create’.
Set up basic parameters and click ‘OK’.
Select size for your VM. I will choose A2_V2 standard.
For optional features, leave everything and default and click ‘OK’.
Wait for validation to pass and click ‘OK’ to start provisioning of your VM.
Before we begin installation of SQL Server, we need to set up NSG to allow traffic over port 1433. Remeber that I’m doing this only for demo as I want to connect to SQL Server from my laptop. Opening port 1433 to public is very bad idea and you shouldn’t do this unless it’s for demo as well.
Go to your VM, select ‘Network interface’ , select ‘Ubuntu’ and finally ‘Network security group’.
Select ‘Inbound security rules’ and click ‘Add’.
Enter parameters to allow traffic over port 1433.
I use Putty to connect to Linux servers and I’ll use same here. After connection to my Linux VM, I can start installation of SQL Server.
First thing to do is import public repository GPG keys so we run:
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add –
After that we need to register MS SQL Server Ubuntu repository and next command is:
curl https://packages.microsoft.com/config/ubuntu/16.04/mssql-server.list | sudo tee /etc/apt/sources.list.d/mssql-server.list
Now it’s time to start package installation. First run:
sudo apt-get update
And then:
sudo apt-get install -y mssql-server
After package installation is finished, it’s time to run configuration script:
sudo /opt/mssql/bin/sqlservr-setup
In configuration you’ll be asked to accept license terms.
Then you need to enter and confirm password for SA account. Password must be at least 8 characters long and contain 3 out of 4 rules of uppercase, lowercase, digit and special character.
Finally, you we’ll be asked if you want to start SQL Server service and if you want to enable SQL Server to start on boot.
And you’re done. Now go to SSMS and connect to your SQL instance.
You can connect with most of SSMS but you’ll need latest version if you really want to do work here.
And you have MS SQL Server running on Linux VM. Best of all is that it took me 17 minutes to set up everything here. Linux VM on Azure, SQL Server… everything from 0 and after 17 minutes I have fully functional MS SQL Server running on Ubuntu. In one of next posts I’ll write more about where to go from here and what you can do with your SQL instance on Linux.
I just wanted to jot down a message in order to thank you for all of the precious information you are giving on this website. My particularly long internet lookup has at the end been recognized with reliable know-how to share with my great friends. I ‘d state that that most of us website visitors actually are rather endowed to be in a useful network with many brilliant individuals with helpful strategies. I feel truly blessed to have seen your entire webpage and look forward to so many more brilliant times reading here. Thanks a lot once again for everything.
Excellent web site. Plenty of useful information here. I am sending it to some pals ans additionally sharing in delicious. And certainly, thanks for your sweat!
Great post, thx. Are you going to write more about SQL on linux like what next, other services etc.
Sure, I’ll try to write on how to restore database, query etc.
M$ is braking to OpenSource big time
I’m trying to install on Ubintu but fails with error. Any idea?
What version of Ubuntu are you using and what error do you get?
This is great, who would dream of any M$ link with Linux 🙂
What limits Linux version has and what services are avaliable?
Only database engine is avaliable for now
Awesome you should think of soeihtmng like that
Great post, thank you!
I have problem with filestream, how do you enable it?
FileStream is not supported right now
fantastic
Works great, tnx!
Great post on fantastic blog!
don’t know whats big racket about this, there are tens of other DBs already on Linux
Just great 🙂
One of best posts I’ve read in long time! Keep up good work!
Every step works! Thanks 🙂
Nice 🙂
Great! Justa great!
Works like a charm 🙂
works for me
Excellent way of explaining, and fastidious piece of writing
very well writen
nice
well done
Thank you! I’m doing essay on this!
This is realy helpful
great post!
What are limits for Linux edition?
Well done !
every step works, no error at all
work for me, give us more steps !
This blog is great but this post is pure genius!
Thx 🙂
You had good posts before but this one tops them. Keep up good work!
How about new post about this subject? I see there are updates on this but realy want to read your post.
What Ston said 🙂
I’ve been absent for some time, but now I remember why I used to love this blog. Thank you, I’ll try and check back more frequently.
I tested you post and it works! Great job!
I agree with Ston! More!
How about you go full time on this and publish every day?
great work
keep it up
All content of this blog is very intersting. But this one is just…wow!
Very detailed. I followed every step and installed with out any problems. Thx!
thanks a lot!
very good article
Well done, sir!
Thanky you 😀
very interesting
Good post!
very helpful, thank you
Can we get more on this please?
Very helpful!
This is great 🙂
Great post!
Shoot, who would have thhugot that it was that easy?
Well done! Great post!
SQL on Linux part 2?
Super 😀
.
Your blog is great but this post tops it all!
Perfect post on fantastic blog! My only issue is that you don’t write more often!
Well done, sir, well done!
Thank you! Works all the way!
You rock!
Fantastic!
Being pro Open Source I must say things are chaning with M$
Thanks!
How come I didn’t visit this blog before? Great posts here, I’ll be back for sure.
Great post
Well done!
Bye-Bye… and Best Regards
Thanks a lot! Great post!
Waiting for new features
Waiting for part II 🙂
Awsome!
Great post! Can we see more on subject?
????? ????????????
Thank you very much!
Nice!
Cool 🙂
Thank you!
Great!TNX!
Your blog is simply briliant, I hope you keep doing this for long time!
Fantastic!
Fantastic post!
Love it!
More services?
Great post! If you follow al steps, works great!
Who would thought about this? 🙂
Nice blog!
Good job 🙂
Wow!
Can we see more of these from you? Thank you!
Great post and great blog! Keep on sharing with us!
Thank you! 🙂
Very nice!
Interesting!
Thumbs up!
Great article!
I constantly spent my half an hour to read this weblog’s posts everyday along with a cup of coffee.
Hi mates, gookd piece of writing and good urging commented at this
place, I am actually enjoying byy these.
anchor
It is simply magnificent idea
Please, keep to the point.
Thanks so much for the article.Much thanks again. Great.
It’s truly a great and useful piece of information. I’m satisfied that you shared this helpful information with us. Please stay us informed like this. Thank you for sharing.
Im not that much of a online reader to be honest but your blogs really nice, keep it up! I’ll go ahead and bookmark your site to come back later. All the best!
Subscribed!
Good article! We will be linking to this particularly great content on our website.
Keep up the great writing.
Thank you for making the sincere try to explain this. I think very robust about it and wish to be told more. If it’s OK, as you reach extra extensive wisdom, could you mind adding more posts similar to this one with additional info? It would be extremely helpful and helpful for me and my colleagues.
Somebody essentially assist to make seriously articles I would state. That is the first time I frequented your website page and to this point? I amazed with the research you made to make this actual put up amazing. Great process!
Hello! I just now would like to supply a massive thumbs up for any wonderful information you could have here within this post. We are coming back to your blog post for further soon.
Glad to be one of many visitors on this awe inspiring website : D.
Hello! I merely would want to make a enormous thumbs up for your excellent info you might have here during this post. I will be returning to your blog for additional soon.
Great job with the research on this post. I am going to share it with my followers on Twitter.. Thanks!