SQL Server 2022 Developer
Videos
Overview: SQL Server 2022 Developer on Azure: overview (watch on YouTube)
Launch and log in: SQL Server 2022 Developer on Azure: launch and log in (watch on YouTube)
Deep Dive: SQL Server 2022 Developer on Azure: deep dive (watch on YouTube)
Overview
SQL Server 2022 is Microsoft's relational database engine. The Developer edition is free and includes every Enterprise edition feature, with no core or memory limit. Microsoft licenses it for development and testing only, never for production.
This SecureAnyCloud image runs SQL Server 2022 Developer Edition on Ubuntu 22.04 on Microsoft Azure. It reports itself as Developer 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.
What you get:
- No shared, default or temporary password. The image ships SQL Server installed but not set up: it contains no
masterdatabase, nosapassword and no machine key. On your VM's first boot,mssql-firstboot.servicegenerates a 32-charactersapassword on the VM and runs Microsoft's unattended setup with it. The password is written 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 startup. 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. - No metadata access. SQL Server and its first-boot service are blocked from the Azure Instance Metadata Service and 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. - Patched base. Ubuntu 22.04 LTS is fully patched at build time, with unattended security upgrades switched on.
- Image contents. SQL Server 2022 Developer Edition 16.0.4305.5 (CU27 with the 2026-10-13 security update, KB5126934),
mssql-tools18(sqlcmd,bcp), Microsoft ODBC Driver 18 for SQL Server 18.7.1.1, cloud-init and the Azure Linux Agent. The Microsoft packages come from the officialpackages.microsoft.comrepositories with the signing key pinned. - Defaults. The default user is the admin user you choose (examples use
azureuser). The architecture is x64, Gen2. The recommended size is Standard_D4s_v3 or larger. - 24/7 SecureAnyCloud support
Licensing
This image does not include a SQL Server license. SQL Server Developer edition is free under the Microsoft Software License Terms, which your VM accepts on first boot. Those terms allow it for development and testing only, never production:
- Build, test and demonstrate your applications, with every Enterprise feature available.
- Do not serve production workloads or production data from it.
- For production, use a licensed Standard or Enterprise edition of SQL Server.
Prerequisites
- An Azure subscription with a subscription to this offer in Azure Marketplace.
- An SSH public key or a password for the VM's admin user.
- 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 Developer, select the SecureAnyCloud offer and select 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, and 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. Select 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-developer-ubuntu-22-04:developer:latest
az vm create \
--resource-group <your-resource-group> \
--name sql-dev-01 \
--image sac1647283583153:mssql-2022-developer-ubuntu-22-04:developer: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 holds a value that is not yet set. 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 which ports are listening. Port 1433 is the database port, open on every interface (IPv4 0.0.0.0 and the dual-stack *). Port 1431 is used by SQL Server itself. Port 1434 is the local dedicated administrator connection (DAC), an emergency connection that 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 903 Oct 21 21:26 /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. The password is unique to this VM.
Do not 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 commands 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 commands use the full path.
Connect with sqlcmd
Connect to the loopback address. The -C flag tells sqlcmd 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 ---------------------------------------- -------------------- ---------- -------------- Developer Edition (64-bit) 16.0.4305.5 CU27 3An engine_edition of 3 is the Enterprise engine, which Developer edition runs.
Confirm the connection is encrypted
SQL Server forces encryption, so even a client that asks only for optional encryption (-No) gets an encrypted session.
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 OpenSSL. The sample output below comes from a different VM.
openssl x509 -in /etc/ssl/mssql/mssql.pem -noout -subject -enddate -ext subjectAltName -fingerprint -sha256subject=CN = mssql-dev-2204-sim-10211957-800566 notAfter=Oct 18 21:24:37 2036 GMT X509v3 Subject Alternative Name: DNS:mssql-dev-2204-sim-10211957-800566, DNS:localhost, IP Address:127.0.0.1, IP Address:10.0.0.11 sha256 Fingerprint=0F:23:5E:E1:6B:CB:E8:47:8E:1E:B8:A2:F0:29:E3:9E:23:19:CF:93:C3:DC:E4:58:36:61:DB:A6:50:E5:6B:EEThe 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 certificate. A client with it passes full verification.
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-dev-2204-sim-10211957-800566On your workstation, copy /etc/ssl/mssql/mssql.pem and add it to the client's trusted certificates, or pin the fingerprint in tools that support it. Copy only the public certificate, never mssql.key.
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 Developer'');'); SELECT id, body FROM demo.dbo.notes; DROP DATABASE demo;"id body -- ---- 1 hello from SQL Server 2022 DeveloperFor an application, create a dedicated login and database instead of using sa. Run the following 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.11 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 you can issue a certificate for that name with mssql-conf set network.tlscert and network.tlskey and 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 following commands list the logins and hardening settings as SQL Server reports them. They also 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.shcreates the TLS key and certificate, generates thesapassword into a root-only file in memory, and runsmssql-conf -n setup accept-eulawithMSSQL_PID=Developer. It passes the password in the environment, never on a command line. While SQL Server is still on the loopback address, the script 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. The 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. They live under
/var/opt/mssql(data/,log/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"Developer 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.
Memory. Developer edition has no memory cap. 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 the service, for example sudo /opt/mssql/bin/mssql-conf set memory.memorylimitmb 4096 followed by sudo systemctl restart mssql-server.
SQL Server Agent. Developer edition includes SQL Server Agent for scheduled jobs. The agent ships turned off. Turn it on when you need it.
sudo /opt/mssql/bin/mssql-conf set sqlagent.enabled true
sudo systemctl restart mssql-serverMoving to production. Developer edition is not licensed for production. When an application is ready to go live, move it to a licensed Standard or Enterprise edition of SQL Server and restore your databases there from backup.
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 Developer 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
This image runs Microsoft SQL Server 2022 Developer Edition on Ubuntu 22.04. Developer Edition has the complete Enterprise feature set and is free, but it is licensed for development and test use only and must not be used in production. SQL Server is the only workload on the image.
This guide covers the Developer delivery option. The same listing offers SQL Server 2022 in other editions. See the SQL Server 2022 on AWS hub to compare them and choose.
What you get:
- SQL Server 2022 Developer Edition, installed from the official Microsoft APT repository, with no technical feature limits (identical to Enterprise)
- The
mssql-tools18package and thesqlcmdcommand-line utility, preinstalled - SQL Server data and log files on a dedicated gp3 EBS volume mounted at
/var/opt/mssql, 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 starting on boot through systemd
- 24/7 SecureAnyCloud support
This is a headless image. SQL Server has no web interface. You administer it over SSH with sqlcmd or any compatible SQL Server client on port 1433.
Prerequisites
Before you deploy this image, you need:
- 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 that allows 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: t3.large or m5.large. Size the instance to your test data.
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 Developer 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 you want external clients to 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 Developer 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 AMI defines the data volume, 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
This delivery option is built on Ubuntu 22.04, so the SSH login user is ubuntu.
ssh ubuntu@<your-instance-ip>Wait for the instance to pass both EC2 status checks before you connect.
Retrieve the generated SA password
The first-boot service writes the per-instance credentials to /root/mssql-credentials.txt, a root-only file. Read it with sudo.
sudo cat /root/mssql-credentials.txtThe file has the following layout. The passwords on your instance are unique.
# SQL Server 2022 Developer 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 the db_owner role on the SecureAnyCloud database and is suitable for application connections.
Connect to SQL Server with sqlcmd
Connect as the SA user to 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 reflects this image's Developer edition.
Microsoft SQL Server 2022 (RTM-CU25) (KB5054531) - 16.0.4255.1 (X64) May 20 2026 12:06:45 Copyright (C) 2022 Microsoft Corporation Developer Edition (64-bit) on Linux (Ubuntu 22.04.5 LTS) <X64>Licensing
SQL Server Developer Edition is a free edition and requires no product key. It is licensed for development and test use only and must not be run in production. For production, use Standard, Web or Enterprise.
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.
Check 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 directory owned by the mssql user, then back up the sac 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
- SQL Server will not start. Read the end of the error log with
sudo cat /var/opt/mssql/log/errorlog | tail -50and the service journal withsudo journalctl -u mssql-server -n 50 --no-pager. - Port 1433 is unreachable. Check the inbound rules of the security group.
- Permission denied on the credentials file. The file is root-only, so read it with
sudo. - First boot did not run. Check
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 Developer on AWS with 24/7 support from SecureAnyCloud.
View on Marketplace
Need Help?
Our support team is available 24/7.
sales@secureanycloud.com