SQL Server 2022 Standard
Videos
Overview: SQL Server 2022 Standard on Azure: overview (watch on YouTube)
Launch and log in: SQL Server 2022 Standard on Azure: launch and log in (watch on YouTube)
Deep Dive: SQL Server 2022 Standard on Azure: deep dive (watch on YouTube)
Overview
SQL Server 2022 is Microsoft's relational database engine. The Standard edition suits production departmental and small-to-midsize workloads. It runs the full database engine within Microsoft's Standard edition limits: the lesser of 4 sockets or 24 cores, and 128 GB of buffer-pool memory (see Microsoft's SQL Server 2022 editions and features). It reports itself as Standard Edition (64-bit). SQL Server 2022 adds ledger tables, contained availability groups, Query Store hints, parameter-sensitive plan optimization and new T-SQL functions such as JSON_OBJECT and JSON_ARRAY.
This SecureAnyCloud image deploys SQL Server 2022 Standard on Ubuntu 22.04 on Microsoft Azure, hardened and set up automatically on the first boot of every VM.
Bring your own licence. No SQL Server licence is included in the price of this image. You must hold SQL Server Standard licences for it (see Licensing).
What you get:
- No shared, default or temporary password. The image ships SQL Server installed but not set up: there is no
masterdatabase, nosapassword and no machine key in the image. On your VM's first boot,mssql-firstboot.servicegenerates a 32-charactersapassword on the VM and runs Microsoft's own unattended setup with it. It then writes the password to/root/mssql-credentials.txt(root-only). No two VMs share a password, a certificate or an instance identity. - Port 1433 opens last. First boot sets SQL Server up on the loopback address only and checks it (edition, password, encryption, certificate) before it opens port 1433 on the VM's network interfaces. SQL Server never listens on the network with any password but your VM's own.
- Fail closed. SQL Server refuses to start until first boot has finished. If first boot cannot complete, SQL Server stays stopped and the next boot tries again.
- TLS on every connection. First boot creates the VM's own TLS key and self-signed certificate. SQL Server forces encryption (TLS 1.2) for every client, even one that does not ask for it.
- One login.
sais the only SQL login, with the password policy enforced. No default database or extra login is created. - Metadata service blocked. SQL Server and its first-boot service cannot reach the Azure Instance Metadata Service or the Azure wire server.
- Hardened defaults. Telemetry (Microsoft's customer feedback program) and SQL Server Agent are off.
xp_cmdshell, OLE Automation, CLR, ad hoc distributed queries and the remote admin connection are all disabled. - Fully patched base. Ubuntu 22.04 LTS is patched at build time, with unattended security upgrades switched on.
- What is on the image: SQL Server 2022 Standard Edition 16.0.4305.5 (CU27 with the 2026-10-13 security update, KB5126934),
mssql-tools18(sqlcmd,bcp) and the Microsoft ODBC Driver 18 for SQL Server 18.7.1.1, all from Microsoft's officialpackages.microsoft.comrepositories with the signing key pinned. cloud-init and the Azure Linux Agent are included. - Defaults: the admin user you choose (examples use
azureuser), x64 Gen2 architecture, and a recommended size of Standard_D4s_v3 or larger.
Licensing
This image is Bring Your Own License (BYOL). No SQL Server licence is included and none is sold with it. The SecureAnyCloud charge covers the image, its hardening, first-boot setup, maintenance and support. Before you run it, you must hold the right Microsoft licences:
- SQL Server 2022 Standard core licences for the VM's vCPUs, under Microsoft's per-core licensing rules.
- Software Assurance with License Mobility, which lets you run those licences on shared Azure virtual machines. Alternatively, run on Azure Dedicated Host as Microsoft's Product Terms allow.
Your VM accepts the Microsoft Software License Terms on first boot and sets the edition with MSSQL_PID=Standard. There is no product key to enter. Direct licensing questions to Microsoft or your Microsoft licensing partner.
Prerequisites
Before you deploy, make sure you have:
- An Azure subscription and a subscription to this offer in Azure Marketplace.
- An SSH public key or a password for the VM's admin user.
- SQL Server 2022 Standard licences with Software Assurance and License Mobility (or Azure Dedicated Host), as described under Licensing.
- A network security group that allows TCP 22 (SSH) from your admin network. Open TCP 1433 only if clients on other hosts must connect directly, and only from their addresses (Step 8).
Deploy the virtual machine from the Azure portal
Search Azure Marketplace for SQL Server 2022 Standard, select the SecureAnyCloud offer and click Create.
On the Basics tab, choose your subscription, resource group and region, and name the VM. Choose Standard_D4s_v3 or larger, because SQL Server needs at least 2 GB of memory. Set the administrator account. Under Inbound port rules, allow SSH (22) only.
On the Disks tab, choose Standard SSD or Premium SSD. SQL Server data lives in /var/opt/mssql/data on the OS disk.
On the Networking tab, keep or select a network security group that allows SSH from your admin network. Click Review + create, then Create.
Deploy the virtual machine from the Azure CLI
Accept the Marketplace terms once per subscription, then create the VM. Replace the values in angle brackets with your own.
az vm image terms accept --urn sac1647283583153:mssql-2022-standard-ubuntu-22-04:default:latest
az vm create \
--resource-group <your-resource-group> \
--name sql-std-01 \
--image sac1647283583153:mssql-2022-standard-ubuntu-22-04:default:latest \
--size Standard_D4s_v3 \
--admin-username azureuser \
--ssh-key-values ~/.ssh/id_rsa.pub \
--nsg-rule SSHFirst boot takes two to three minutes while SQL Server's setup creates the system databases. Until it finishes, systemctl is-active mssql-firstboot reports activating and /root/mssql-credentials.txt does not yet hold the real password. Later boots start SQL Server in seconds.
Connect and check the service
Connect to the VM over SSH:
ssh azureuser@<vm-public-ip>Confirm that the first-boot service and SQL Server both report active:
systemctl is-active mssql-firstboot mssql-serveractive activeCheck what is listening. Port 1433 is the database port, open on every interface (IPv4 0.0.0.0 and the dual-stack *). Port 1431 is a SQL Server port used only on the VM. Port 1434 is the local dedicated administrator connection (DAC), the emergency connection a sysadmin can use from the VM itself when SQL Server stops responding. Both stay on the loopback address, and remote DAC is off.
sudo ss -Htlnp | awk '{print $4, $6}' | sed 's/,pid=[0-9]*,fd=[0-9]*//g' | sort -u*:1433 users:(("sqlservr")) 0.0.0.0:1433 users:(("sqlservr")) 0.0.0.0:22 users:(("sshd")) 127.0.0.1:1431 users:(("sqlservr")) 127.0.0.1:1434 users:(("sqlservr")) 127.0.0.53%lo:53 users:(("systemd-resolve")) [::1]:1431 users:(("sqlservr")) [::1]:1434 users:(("sqlservr")) [::]:22 users:(("sshd"))Get your sa password
The credentials file is readable only by root. List the setting names it holds.
sudo ls -l /root/mssql-credentials.txt
sudo grep -oE '^[A-Z_0-9]+=' /root/mssql-credentials.txt-rw------- 1 root root 1201 Oct 23 12:37 /root/mssql-credentials.txt SA_USER= SA_PASSWORD= <set-at-first-boot>= SQL_ENDPOINT_PRIVATE= SQL_EDITION= TLS_CERT= TLS_CERT_SHA256=Read the whole file with sudo cat /root/mssql-credentials.txt and store the password in your password manager. It is unique to this VM.
Never pass the password to sqlcmd with -P, because it would land in your shell history and the process list. sqlcmd reads it from the SQLCMDPASSWORD environment variable instead. Load it once per shell:
export SQLCMDPASSWORD="$(sudo awk -F= '/^SA_PASSWORD=/{print $2}' /root/mssql-credentials.txt)"The blocks below repeat that line so that each one works on its own. sqlcmd is on the PATH of every login shell (/opt/mssql-tools18/bin), and the blocks use the full path.
Connect with sqlcmd
Run sqlcmd on the VM. The -C flag tells it to trust the VM's self-signed certificate. Step 6 shows how to verify the certificate instead.
export SQLCMDPASSWORD="$(sudo awk -F= '/^SA_PASSWORD=/{print $2}' /root/mssql-credentials.txt)" /opt/mssql-tools18/bin/sqlcmd -S 127.0.0.1 -U sa -C -Q "SET NOCOUNT ON; SELECT CAST(SERVERPROPERTY('Edition') AS nvarchar(40)) AS edition, CAST(SERVERPROPERTY('ProductVersion') AS nvarchar(20)) AS version, CAST(SERVERPROPERTY('ProductUpdateLevel') AS nvarchar(10)) AS cu, CAST(SERVERPROPERTY('EngineEdition') AS int) AS engine_edition"edition version cu engine_edition ---------------------------------------- -------------------- ---------- -------------- Standard Edition (64-bit) 16.0.4305.5 CU27 2An engine_edition of 2 is the Standard engine.
Confirm the connection is encrypted
SQL Server forces encryption, so even a client that asks only for optional encryption (-No) gets an encrypted session. Run:
export SQLCMDPASSWORD="$(sudo awk -F= '/^SA_PASSWORD=/{print $2}' /root/mssql-credentials.txt)" /opt/mssql-tools18/bin/sqlcmd -S 127.0.0.1 -U sa -C -No -Q "SET NOCOUNT ON; SELECT encrypt_option, protocol_type, auth_scheme FROM sys.dm_exec_connections WHERE session_id = @@SPID"encrypt_option protocol_type auth_scheme ---------------------------------------- ---------------------------------------- ---------------------------------------- TRUE TSQL SQLThe certificate is this VM's own, named after its hostname (the VM name) and addresses. Inspect it with the command below. The sample output is from a different VM, so your names and fingerprint will differ.
openssl x509 -in /etc/ssl/mssql/mssql.pem -noout -subject -enddate -ext subjectAltName -fingerprint -sha256subject=CN = mssql-std-2204-simA-10231152-264a62 notAfter=Oct 20 12:35:13 2036 GMT X509v3 Subject Alternative Name: DNS:mssql-std-2204-simA-10231152-264a62, DNS:localhost, IP Address:127.0.0.1, IP Address:10.0.0.12 sha256 Fingerprint=74:D2:6D:37:BC:F4:99:F1:4E:CD:FE:91:89:46:C6:AF:C9:FC:77:08:4C:92:DB:37:07:44:79:30:30:A1:1E:8BThe same fingerprint is in /root/mssql-credentials.txt as TLS_CERT_SHA256. To verify the server instead of trusting it blindly, make the certificate the client's trusted certificate and drop -C. A client without the certificate refuses the self-signed one. With it, full verification passes:
export SQLCMDPASSWORD="$(sudo awk -F= '/^SA_PASSWORD=/{print $2}' /root/mssql-credentials.txt)" SSL_CERT_FILE=/etc/ssl/mssql/mssql.pem /opt/mssql-tools18/bin/sqlcmd -S 127.0.0.1 -U sa -F "$(hostname)" -h -1 -Q "SET NOCOUNT ON; SELECT N'verified: ' + CAST(SERVERPROPERTY('ServerName') AS nvarchar(64))"verified: mssql-std-2204-simA-10231152-264a62On your workstation, copy /etc/ssl/mssql/mssql.pem and add it to the client's trusted certificates. This is the public certificate, so never copy mssql.key. In tools that support it, you can pin the fingerprint instead.
Run SQL
Create a database, write a row, read it back and drop the database:
export SQLCMDPASSWORD="$(sudo awk -F= '/^SA_PASSWORD=/{print $2}' /root/mssql-credentials.txt)" /opt/mssql-tools18/bin/sqlcmd -S 127.0.0.1 -U sa -C -W -Q "SET NOCOUNT ON; CREATE DATABASE demo; EXEC('USE demo; CREATE TABLE dbo.notes (id INT IDENTITY PRIMARY KEY, body NVARCHAR(200) NOT NULL); INSERT INTO dbo.notes (body) VALUES (N''hello from SQL Server 2022 Standard'');'); SELECT id, body FROM demo.dbo.notes; DROP DATABASE demo;"id body -- ---- 1 hello from SQL Server 2022 StandardFor an application, create a dedicated login and database instead of using sa. Run the statements below in an interactive sqlcmd session (/opt/mssql-tools18/bin/sqlcmd -S 127.0.0.1 -U sa -C) and choose your own strong password:
CREATE DATABASE appdb; GO CREATE LOGIN appuser WITH PASSWORD = N'<a-strong-password>', CHECK_POLICY = ON; GO USE appdb; CREATE USER appuser FOR LOGIN appuser; ALTER ROLE db_owner ADD MEMBER appuser; GOConnect from other hosts
SQL Server listens on port 1433 on the VM's network interfaces with encryption forced, so a client on another host can connect once your network security group allows it. Allow TCP 1433 only from the addresses that need it, never from Internet or *.
az network nsg rule create --resource-group <your-resource-group> --nsg-name <your-vm-nsg> \
--name allow-sql-from-app --priority 310 --access Allow --protocol Tcp --direction Inbound \
--source-address-prefixes <client-ip-or-cidr> --destination-port-ranges 1433From the VM itself, confirm that the private address accepts an encrypted session:
export SQLCMDPASSWORD="$(sudo awk -F= '/^SA_PASSWORD=/{print $2}' /root/mssql-credentials.txt)" /opt/mssql-tools18/bin/sqlcmd -S "$(hostname -I | awk '{print $1}'),1433" -U sa -C -No -h -1 -Q "SET NOCOUNT ON; SELECT CAST(client_net_address AS varchar(20)) + ' encrypted=' + CAST(encrypt_option AS varchar(5)) FROM sys.dm_exec_connections WHERE session_id = @@SPID"10.0.0.12 encrypted=TRUEConnect SQL Server Management Studio, Azure Data Studio, VS Code or your application to <vm-ip>,1433. Use SQL Server authentication as sa (or your application login) and set encryption to Mandatory. Either trust the server certificate or install mssql.pem as a trusted certificate (Step 6).
The certificate names the VM's hostname, localhost and its private address. Clients that connect by another name must trust the certificate, or use a certificate you issue for that name (mssql-conf set network.tlscert and network.tlskey, then restart).
To keep port 1433 closed to the network entirely, bind SQL Server to the loopback address and use an SSH tunnel (ssh -N -L 1433:127.0.0.1:1433 azureuser@<vm-public-ip>):
sudo /opt/mssql/bin/mssql-conf set network.ipaddress 127.0.0.1
sudo systemctl restart mssql-serverSecurity details
The commands below list the logins and hardening settings as SQL Server reports them, and show that a wrong password is refused.
export SQLCMDPASSWORD="$(sudo awk -F= '/^SA_PASSWORD=/{print $2}' /root/mssql-credentials.txt)" /opt/mssql-tools18/bin/sqlcmd -S 127.0.0.1 -U sa -C -W -Q "SET NOCOUNT ON; SELECT name, CAST(is_policy_checked AS int) AS policy_checked, CAST(is_disabled AS int) AS disabled FROM sys.sql_logins WHERE name NOT LIKE N'##%' ORDER BY name" /opt/mssql-tools18/bin/sqlcmd -S 127.0.0.1 -U sa -C -W -Q "SET NOCOUNT ON; SELECT name, CAST(value_in_use AS int) AS value_in_use FROM sys.configurations WHERE name IN (N'xp_cmdshell', N'clr enabled', N'Ole Automation Procedures', N'Ad Hoc Distributed Queries', N'remote admin connections') ORDER BY name" SQLCMDPASSWORD=<set-at-first-boot> /opt/mssql-tools18/bin/sqlcmd -S 127.0.0.1 -U sa -C -Q "SELECT 1" 2>&1 | head -1 || truename policy_checked disabled ---- -------------- -------- sa 1 0 name value_in_use ---- ------------ Ad Hoc Distributed Queries 0 clr enabled 0 Ole Automation Procedures 0 remote admin connections 0 xp_cmdshell 0 Sqlcmd: Error: Microsoft ODBC Driver 18 for SQL Server : Login failed for user 'sa'..Check the network, TLS and telemetry settings, and the metadata block on both services:
sudo /opt/mssql/bin/mssql-conf get network
sudo /opt/mssql/bin/mssql-conf get telemetry customerfeedback systemctl show -p IPAddressDeny mssql-server mssql-firstboottcpport : 1433 tlscert : /etc/ssl/mssql/mssql.pem tlskey : /etc/ssl/mssql/mssql.key tlsprotocols : 1.2 forceencryption : 1 customerfeedback : false IPAddressDeny=169.254.169.254/32 168.63.129.16/32 IPAddressDeny=169.254.169.254/32 168.63.129.16/32- First boot (
/usr/local/sbin/mssql-firstboot.sh) creates the TLS key and certificate. It generates thesapassword into a root-only file in memory and runsmssql-conf -n setup accept-eulawithMSSQL_PID=Standard, passing the password in the environment (never on a command line). While SQL Server is still on the loopback address, it checks the edition and build, that a wrongsapassword is refused, that the connection is encrypted, that port 1433 serves the VM's own certificate and that the metadata service is unreachable. Only then does it open port 1433 on the network, repeat the login, refusal and certificate checks over the VM's private address, and write the credentials file. Its log is available withjournalctl -u mssql-firstboot. - Start gate.
mssql-server.servicehas a drop-in,/etc/systemd/system/mssql-server.service.d/50-sac.conf. It blocks the metadata service and refuses to start before first boot has written/var/lib/sac/data/mssql-ready. - SSH.
/etc/ssh/sshd_config.d/00-sac.confturns off root login, empty passwords and X11 forwarding. Password or key login for your admin user follows the choice you made when you created the VM. - Data and logs live under
/var/opt/mssql(data/andlog/errorlog). The configuration file is/var/opt/mssql/mssql.conf.
Maintenance
Updates. Ubuntu security updates install automatically. SQL Server cumulative and security updates come from Microsoft's repository, which the image already trusts. Install them when you are ready:
sudo apt-get update
sudo apt-get install --only-upgrade mssql-server mssql-tools18 msodbcsql18Backups. Back up to a local file, then copy it off the VM, for example to Azure Blob Storage:
sqlcmd -S 127.0.0.1 -U sa -C -Q "BACKUP DATABASE appdb TO DISK = N'/var/opt/mssql/data/appdb.bak' WITH CHECKSUM"Standard edition supports backup compression (WITH COMPRESSION) and encrypted backups. Take Azure disk snapshots as a second layer of protection.
Change the sa password. Connect as sa and run ALTER LOGIN sa WITH PASSWORD = N'<new-password>';. Then update /root/mssql-credentials.txt if you keep that file current.
Memory. Standard edition uses at most 128 GB for the buffer pool. By default, SQL Server on Linux uses up to 80% of the VM's memory. To leave more for other software, set a limit and restart, for example sudo /opt/mssql/bin/mssql-conf set memory.memorylimitmb 4096 then sudo systemctl restart mssql-server.
SQL Server Agent. Standard edition includes SQL Server Agent for scheduled jobs. It ships turned off. Turn it on when you need it:
sudo /opt/mssql/bin/mssql-conf set sqlagent.enabled true
sudo systemctl restart mssql-serverLicences when you resize. Standard is licensed per core. If you move to a VM size with more vCPUs, make sure your SQL Server core licences cover it. SQL Server uses only the cores its edition allows, and the errorlog line using N logical processors based on SQL Server licensing shows the count.
Support
SecureAnyCloud provides 24/7 technical support for this image by email and live chat at sales@secureanycloud.com. Direct SQL Server licensing questions to Microsoft.
Microsoft, Azure and SQL Server are trademarks of the Microsoft group of companies. Ubuntu is a registered trademark of Canonical Ltd. SecureAnyCloud is not affiliated with or endorsed by Microsoft or Canonical.
Deploy on Azure
Launch SQL Server 2022 Standard on Ubuntu 22.04 LTS on Azure with 24/7 support from SecureAnyCloud.
View this image
Need Help?
Our support team is available 24/7.
sales@secureanycloud.com
Overview
Microsoft SQL Server 2022 Standard Edition is the core relational engine for mid-tier production workloads. This SecureAnyCloud image runs it as the only workload on the instance, so the platform stays lean and predictable. This guide covers the Standard delivery option. SQL Server 2022 is also offered in other editions on the same listing, so see the SQL Server 2022 on AWS hub to compare and choose.
Standard Edition delivers the core relational engine and the SQL Server 2022 feature set within the Standard licensing envelope. It supports up to 24 cores and 128 GB of buffer-pool memory, basic Always On availability (a single secondary replica) and backup compression.
This is a headless image. SQL Server has no web interface, so you administer it over SSH with sqlcmd or any compatible SQL Server client on port 1433.
What you get:
- SQL Server installed from the official Microsoft APT repository, with the
mssql-tools18package and thesqlcmdcommand-line utility preinstalled - A dedicated gp3 EBS volume mounted at
/var/opt/mssqlfor SQL Server data and log files, separate from the OS disk and independently resizable - A one-shot first-boot service that generates a fresh SA password, creates a dedicated SecureAnyCloud SQL login, removes the build-time memory cap and writes all credentials to /root/mssql-credentials.txt, a file only root can read
- No shared or default credentials in the image
- SQL Server listening on port 1433 and started on boot by systemd
Prerequisites
Before you deploy this image, make sure you have:
- An Amazon Web Services account where you can launch EC2 instances
- IAM permissions to launch instances, create security groups, and subscribe to AWS Marketplace products
- An EC2 key pair in the target Region for SSH access to the instance
- A VPC and subnet in the target Region, with a security group allowing inbound port 22 from your management network
- The AWS CLI (version 2) installed locally if you plan to deploy from the command line
Recommended instance type: m5.xlarge (4 vCPU, 16 GB RAM) or larger.
Launch the instance from the AWS Marketplace
Sign in to the AWS Management Console, open the EC2 service and select Launch instance. Under Application and OS Images, choose AWS Marketplace AMIs and search for SQL Server 2022. Select the SecureAnyCloud listing and choose Select. On the subscription summary, pick the SQL Server 2022 Standard on Ubuntu 22.04 delivery option and choose Continue.
Pick an instance type that suits your workload (see Prerequisites). Choose your EC2 key pair under Key pair (login). Under Network settings, select your VPC and subnet, and a security group that allows inbound port 22 from your management network. Add port 1433 if external clients must connect to SQL Server directly. The AMI brings its own data volume, so leave the block device mappings at their defaults.
Select Launch instance. First-boot initialization generates the SA password and starts SQL Server. It takes a minute or two after the instance state becomes Running and the status checks pass.
Launch the instance from the AWS CLI
Replace <ami-id> with the AMI ID shown on the Marketplace listing for the Standard delivery option. Replace the network and key values in angle brackets with your own.
aws ec2 run-instances \
--image-id <ami-id> \
--instance-type m5.xlarge \
--key-name <key-name> \
--subnet-id <subnet-id> \
--security-group-ids <security-group-id> \
--metadata-options HttpTokens=required \
--tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=mssql-01}]'The data volume is defined in the AMI, so you do not need to specify it. Once the instance is running, retrieve its public address:
aws ec2 describe-instances --instance-ids <instance-id> \
--query "Reservations[].Instances[].PublicIpAddress" --output textConnect over SSH
Wait until the instance has passed both EC2 status checks. This delivery option is built on Ubuntu 22.04, so the SSH login user is ubuntu:
ssh ubuntu@<your-instance-ip>Retrieve the generated SA password
The first-boot service writes the per-instance credentials to /root/mssql-credentials.txt (root-only). Read the file:
sudo cat /root/mssql-credentials.txtThe file looks like this. Your instance has its own unique passwords.
# SQL Server 2022 Standard Edition -- Per-Instance Credentials
# Generated: Wed Jun 04 09:00:00 UTC 2026
# SA_USER=sa SA_PASSWORD=<set-at-first-boot> SAC_USER=sac SAC_PASSWORD=<set-at-first-boot> SAC_DATABASE=sacThe SecureAnyCloud login has db_owner on the SecureAnyCloud database and is suitable for application connections.
Connect to SQL Server with sqlcmd
Connect as sa over the loopback address.
SA_PASS=$(sudo grep '^SA_PASSWORD=' /root/mssql-credentials.txt | cut -d= -f2-) /opt/mssql-tools18/bin/sqlcmd -S 127.0.0.1 -U sa -P "${SA_PASS}" -CThe -C flag trusts the self-signed server certificate. Type GO to run a batch and exit to quit.
Verify the version and edition
Query the server version:
SA_PASS=$(sudo grep '^SA_PASSWORD=' /root/mssql-credentials.txt | cut -d= -f2-) /opt/mssql-tools18/bin/sqlcmd -S 127.0.0.1 -U sa -P "${SA_PASS}" -C -Q "SELECT @@VERSION"The output resembles the following. The edition line shows this image's Standard edition.
Microsoft SQL Server 2022 (RTM-CU25) (KB5054531) - 16.0.4255.1 (X64) May 20 2026 12:06:45 Copyright (C) 2022 Microsoft Corporation Standard Edition (64-bit) on Linux (Ubuntu 22.04.5 LTS) <X64>Licensing
This image installs SQL Server Standard Edition with evaluation licensing. To license it for production, stop the service, apply your 25-character product key and restart the service:
sudo systemctl stop mssql-server
sudo MSSQL_PID='<your-25-char-product-key>' /opt/mssql/bin/mssql-conf -n setup
sudo systemctl start mssql-serverAfterwards, confirm the edition with the SERVERPROPERTY('Edition') query in Step 6.
Check the SQL Server service
Check the service status:
sudo systemctl status mssql-server --no-pagerManage the service with sudo systemctl {stop,start,restart} mssql-server.
Inspect the data volume
SQL Server data and log files are stored on a dedicated gp3 EBS volume mounted at /var/opt/mssql, separate from the OS disk. Confirm the mount:
df -h /var/opt/mssql lsblkTo grow the volume, resize the EBS volume in the AWS console, then extend the filesystem on the instance:
sudo resize2fs $(findmnt -no SOURCE /var/opt/mssql)Create a database and table
Create a database and a table, insert a row and read it back:
SA_PASS=$(sudo grep '^SA_PASSWORD=' /root/mssql-credentials.txt | cut -d= -f2-) /opt/mssql-tools18/bin/sqlcmd -S 127.0.0.1 -U sa -P "${SA_PASS}" -C -Q "IF DB_ID('myapp') IS NULL CREATE DATABASE [myapp];" /opt/mssql-tools18/bin/sqlcmd -S 127.0.0.1 -U sa -P "${SA_PASS}" -C -d myapp -Q "IF OBJECT_ID('customers') IS NULL CREATE TABLE customers (id INT IDENTITY PRIMARY KEY, name NVARCHAR(100), email NVARCHAR(200)); INSERT INTO customers (name,email) VALUES ('Alice Smith','alice@example.com'); SELECT id,name,email FROM customers;"Connect from a remote client
SQL Server listens on port 1433. Add port 1433 to the security group, then connect with SSMS, Azure Data Studio, DBeaver or sqlcmd:
/opt/mssql-tools18/bin/sqlcmd -S <your-instance-ip>,1433 -U sa -P "<SA_PASSWORD>" -CBack up the database
Create a backup folder owned by the mssql user and back up the SecureAnyCloud database with compression:
sudo mkdir -p /var/opt/mssql/backup && sudo chown mssql:mssql /var/opt/mssql/backup
SA_PASS=$(sudo grep '^SA_PASSWORD=' /root/mssql-credentials.txt | cut -d= -f2-) /opt/mssql-tools18/bin/sqlcmd -S 127.0.0.1 -U sa -P "${SA_PASS}" -C -Q \
"BACKUP DATABASE [sac] TO DISK = N'/var/opt/mssql/backup/sac.bak' WITH INIT, COMPRESSION;"Troubleshooting
Use these checks to diagnose common problems.
- Will not start:
sudo cat /var/opt/mssql/log/errorlog | tail -50andsudo journalctl -u mssql-server -n 50 --no-pager. - Port 1433 unreachable: check the security group inbound rules.
- Credentials permission denied: the file is root-only, so use
sudo. - First boot did not run:
sudo journalctl -u mssql-firstboot -n 50 --no-pagerandsudo cat /var/log/mssql-firstboot.log.
SecureAnyCloud Support
SecureAnyCloud supports this image. For help with SQL Server deployment, configuration, performance tuning, high availability or administration, contact sales@secureanycloud.com. Support is available 24 hours a day, 7 days a week.
Deploy on AWS
Launch SQL Server 2022 Standard on AWS with 24/7 support from SecureAnyCloud.
View on Marketplace
Need Help?
Our support team is available 24/7.
sales@secureanycloud.com