Working with Sql Server on Archlinux
Just a few simple step to make your linux works with mssql
In this post, I will covers how I installed Microsoft SQL Server on Arch Linux. I do this using AUR repositories.
Installtion
Fist install needed package using Yay
mssql-server – this is for the main MS SQL Server installation msodbcsql – this is for connecting to MS SQL Server mssql-tools – these are the command line tools for interacting with MS SQL Server
|
|
After all three of the packages have been installed. The mssql-server service should also now be running and enabled to start automatically. You can check by running:
|
|
If it’s showing as “inactive (dead)” you can easily start the service and enable it to run automatically:
|
|
Setup
Use simple command to setup mssql
|
|
Feel free to choose any edition which depend on your purpose, the output may look like
|
|
Click the arrow to see the content !!
Make sure you accept the license terms, type Yes
Then enter SQL Server system administartor password
Create Database
|
|
If you get error : Sqlcmd: Error: Microsoft ODBC Driver 18 for SQL Server : SSL Provider: [error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed:self signed certificate]
When SQL Server gets installed it is configured with a self-signed X.509 certificate. If you want to use encrypted connections (with Encrypt=yes; in the connection string, which is the default now) you’ll either need to 1) get the X.509 certificate’s public key from the server and add it to your trusted certificates store on the client or 2) use the TrustServerCertificate=yes; setting in your connection string
Or simply use command
|
|
Ex:
|
|
Using Visual-Studio-Code
You can install vscode and some extentions to work with mssql easier
Open vscode, Ctrl + P
and install:
ext install ms-mssql.mssql
Click the icon of mssql extentions which showing on Activity Bar and Add Connection
-
Hostname:
localhost
-
Database name: enter to skip
-
Authentication Type: SQL Login
-
User name :
sa
-
Password: The password which you created before
-
Save password: Your choice
-
Enter display name: Your choice
Then just create a simple query and test it ^^
Troubleshoot
If you get trouble, feel free to contact me.
If you find my blog helpful, please consider sponsoring <3
Sponsor