WSL is primarily aimed at developers, and it allows you to run Linux environments directly on Windows in a native format and without the overhead of a virtual machine. Let us retake a look at that statement: run Linux environments directly on Windows in a native format. Yes native format, WSL is not a UNIX-like environment like Cygwin, which wraps non-Windows functionality in Win32 system calls but it serves Linux programs as special, isolated minimal processes (pico-processes) attached to kernel-mode pico-providers. If you want to read all the “gory” details about WSL: Windows Subsystem for Linux Overview gives you an excellent introduction.
Surprisingly, it’s pretty easy—I would have expected some strange compatibility issues.
This has been an issue for sometime until now. I found the following link that help me install SQL Server on the latest Ubuntu 18.04:
But, there are few missing steps which can help ease the burden of errors. At the same time, the information is a little out-dated.
But, it works with the following adjustments.
Please Understand!! This is NOT approved by Microsoft. Use this method for Test Only!!
I’m waiting somewhat impatiently for Microsoft and Hortonworks to support Ubuntu 18.04.
I setup a new instance of SQL Server on Linux some time ago. At the time, the Linux machine didn’t have any Samba running, and no real “name” on the network. As a result, after installing SQL Server I got a NULL when running SELECT @@SERVERNAME.
The fix is easy. It’s what you’d do if you had the wrong name.
Read on for the command, and don’t forget to restart the database engine afterward.
When I first started playing with this version, I noticed that SQL Agent was disabled. That’s not great, since SQL Agent is a great tool for various tasks in SQL Server. I can’t start the agent from here, as the underlying implementation is different, and I’m not really a host OS admin when connecting in SSMS.
After checking which patch level I was at (CU6), I changed to my Linux console, and ran the configuration utility. For Linux, this is mssql-conf.
It’s not an overly complicated process but the process is a bit different from Windows, so check it out.
As many of us are familiar with, GDPR is approaching and we made some updates. In the past, file history stored entire T-SQL queries. However, if the query contained any secrets or passwords, it wasn’t smart enough to scrub those out. This is no longer the case, and now file history has been updated to no longer store secrets or passwords.
In addition, we have added 24-hour rotation of UserID when we collect telemetry.
Read on for other improvements.
To create the VMs, you need to go through these four steps:
Basics to configure basic setting of the VM
Size to choose the VM machine size
Settings to configure the features. In this case, the default values are used. You just need to click the Next button to proceed further
Once it’s running, Prashanth shows how to connect via PuTTY and configure the service.
So, I bit: the tweet he referenced was announcing a new version of the SQL Server module (21.0.17240). Here’s a quick list of the updates included:
- Added Get-SqlBackupHistory cmdlet
- Ported PS Provider to .NET Core for PowerShell 6 support
- Ported a subset of cmdlets to .NET Core for PowerShell 6 support
- Powershell 6 support on macOS and Linux in Preview.
- To use SqlServer provider on macOS and Linux mount it using a new PSDrive. Examples in documentation.
- Removed restriction of 64-bit OS for this module. Note: Invoke-Sqlcmd cmdlet is the only cmdlet not supported on 32-bit OS.
The bold lines are my emphasis: with PowerShell 6 support for Linux and macOS, that opens up new avenues for connecting to and automating SQL Server from any platform. This is exciting stuff. I couldn’t wait to take it for a spin, so I set up a quick demo environment to test it out.
It’s not perfect but it did give Drew the vapors, which is a good sign that they’re on the right track.
For some reason, I finished doing an “sudo apt update” follow by the “sudo apt upgrade“, and after doing some OS updates “my SQL Server stopped working”. The following message was logged in the log event: (see Image)
Click through to see how to force a rebuild of master.
If you have experience with PowerShell, some properties of Bash variables will feel familiar. In Bash, variables are denoted with a
$just like in PowerShell, but unlike PowerShell the
$is only needed when they are being referenced. When you are assigning a value to a variable, the
$is left off:
Above we assigned a value to
my_varwithout using the
$, but when we then referenced it in the
printfstatement, we had to use a
$. We also enclosed the variable name in curly braces. This is not required in all cases, but it is a good idea to get in the habit of using them. In cases where you are using positional parameters above 9 (we’ll talk about this later) or you are using a variable in the middle of a string the braces are required, but there is no harm in adding them every time you use a variable in a string.
The basic syntax is pretty familiar to most programming languages, and there’s nothing scary about outputs, even when Mark starts getting into streams.
A web search will almost certainly point you to lots of similar posts, mostly (if not) all of which start instructing you to add unofficial or unrecognized sources, keys etc. Therefore my intention with this post is not to replace official documentation, but to make the process as simple as possible, whilst still pointing to all the official documentation so that you can be confident you are not breaking security or other such things!
You can head over to the following Docker page Get Docker CE for Ubuntu for the initial setup and updates, but for simplicity, you can follow along below.
The installation instructions will also work for Ubuntu and other related variants.