Ubuntu 22.04
Sponsored Link

SQL Server 2022 : स्थापित करना2023/12/07

 
Microsoft SQL सर्वर 2022 स्थापित करें।
इसे स्थापित करने और उपयोग करने से पहले, नीचे लाइसेंस शर्तों को अच्छी तरह से पढ़ें।
यदि आप इसे उत्पादन परिवेश में उपयोग करते हैं, तो यह मुफ़्त नहीं है, इसके लिए लाइसेंस खरीदने की आवश्यकता है।
⇒ https://www.microsoft.com/en-us/sql-server/sql-server-2022-pricing
[1] SQL सर्वर 2022 रिपॉजिटरी जोड़ें और इसे इंस्टॉल करें।
root@dlp:~#
wget https://packages.microsoft.com/keys/microsoft.asc -O /etc/apt/keyrings/mssql2022.key

root@dlp:~#
wget https://packages.microsoft.com/config/ubuntu/22.04/mssql-server-2022.list -O /etc/apt/sources.list.d/mssql-server-2022.list

root@dlp:~#
wget https://packages.microsoft.com/config/ubuntu/22.04/prod.list -O /etc/apt/sources.list.d/msprod.list
root@dlp:~#
vi /etc/apt/sources.list.d/mssql-server-2022.list
# निम्नानुसार सेटिंग जोड़ें
deb [signed-by=/etc/apt/keyrings/mssql2022.key arch=amd64,armhf,arm64] https://packages.microsoft.com/ubuntu/22.04/mssql-server-2022 jammy main

root@dlp:~#
vi /etc/apt/sources.list.d/msprod.list
# निम्नानुसार सेटिंग जोड़ें
deb [signed-by=/etc/apt/keyrings/mssql2022.key arch=amd64,armhf,arm64] https://packages.microsoft.com/ubuntu/22.04/prod jammy main

root@dlp:~#
apt update

root@dlp:~#
apt -y install mssql-server mssql-tools unixodbc-dev


# लाइसेंस शर्तों को स्वीकार करें
    +---------------------+ Configuring msodbcsql17 +---------------------+
    |                                                                     |
    | The license terms for this product can be downloaded from           |
    | https://aka.ms/odbc17eula and found in                              |
    | /usr/share/doc/msodbcsql17/LICENSE.txt.                             |
    |                                                                     |
    | By choosing 'Yes', you indicate that you accept the license terms.  |
    |                                                                     |
    | Do you accept the license terms?                                    |
    |                                                                     |
    |                  <Yes>                     <No>                     |
    |                                                                     |
    +---------------------------------------------------------------------+

# लाइसेंस शर्तों को स्वीकार करें
    +---------------------+ Configuring mssql-tools +---------------------+
    |                                                                     |
    | The license terms for this product can be downloaded from           |
    | http://go.microsoft.com/fwlink/?LinkId=746949 and found in          |
    | /usr/share/doc/mssql-tools/LICENSE.TXT.                             |
    |                                                                     |
    | By choosing 'Yes', you indicate that you accept the license terms.  |
    |                                                                     |
    | Do you accept the license terms?                                    |
    |                                                                     |
    |                  <Yes>                     <No>                     |
    |                                                                     |
    +---------------------------------------------------------------------+
[2] आरंभिक सेटअप चलाएँ.
root@dlp:~#
/opt/mssql/bin/mssql-conf setup

Choose an edition of SQL Server:
  1) Evaluation (free, no production use rights, 180-day limit)
  2) Developer (free, no production use rights)
  3) Express (free)
  4) Web (PAID)
  5) Standard (PAID)
  6) Enterprise (PAID) - CPU core utilization restricted to 20 physical/40 hyperthreaded
  7) Enterprise Core (PAID) - CPU core utilization up to Operating System Maximum
  8) I bought a license through a retail sales channel and have a product key to enter.
  9) Standard (Billed through Azure) - Use pay-as-you-go billing through Azure.
 10) Enterprise Core (Billed through Azure) - Use pay-as-you-go billing through Azure.

Details about editions can be found at
https://go.microsoft.com/fwlink/?LinkId=2109348&clcid=0x409

Use of PAID editions of this software requires separate licensing through a
Microsoft Volume Licensing program.
By choosing a PAID edition, you are verifying that you have the appropriate
number of licenses in place to install and run this software.
By choosing an edition billed Pay-As-You-Go through Azure, you are verifying
that the server and SQL Server will be connected to Azure by installing the
management agent and Azure extension for SQL Server.

# वह संस्करण चुनें जिसका आप उपयोग करना चाहते हैं
Enter your edition(1-10): 2
The license terms for this product can be found in
/usr/share/doc/mssql-server or downloaded from: https://aka.ms/useterms

The privacy statement can be viewed at:
https://go.microsoft.com/fwlink/?LinkId=853010&clcid=0x409

# लाइसेंस के लिए सहमत
Do you accept the license terms? [Yes/No]:Yes

# व्यवस्थापक पासवर्ड सेट करें
Enter the SQL Server system administrator password:
Confirm the SQL Server system administrator password:
Configuring SQL Server...

ForceFlush is enabled for this instance.
ForceFlush feature is enabled for log durability.
Created symlink /etc/systemd/system/multi-user.target.wants/mssql-server.service → /lib/systemd/system/mssql-server.service.
Setup has completed successfully. SQL Server is now starting.

root@dlp:~#
systemctl status mssql-server

*  mssql-server.service - Microsoft SQL Server Database Engine
     Loaded: loaded (/lib/systemd/system/mssql-server.service; enabled; vendor >
     Active: active (running) since Fri 2023-11-24 09:28:25 JST; 3min 37s ago
       Docs: https://docs.microsoft.com/en-us/sql/linux
   Main PID: 2308 (sqlservr)
      Tasks: 205
     Memory: 791.1M
        CPU: 5.725s
     CGroup: /system.slice/mssql-server.service
             +-- 2308 /opt/mssql/bin/sqlservr
             +-- 2344 /opt/mssql/bin/sqlservr

root@dlp:~#
echo 'export PATH=$PATH:/opt/mssql-tools/bin' > /etc/profile.d/mssql.sh

root@dlp:~#
source /etc/profile.d/mssql.sh

[3] कार्य को सत्यापित करने के लिए SQL सर्वर से कनेक्ट करें।
root@dlp:~#
sqlcmd -S localhost -U SA

Password:  
# आपके द्वारा सेट किया गया एडमिन पासवर्ड


# सिस्टम डेटाबेस दिखाएँ
1> select name,database_id from sys.databases; 
2> go 
name                  database_id
--------------------- -----------
master                          1
tempdb                          2
model                           3
msdb                            4

(4 rows affected)

# सिस्टम उपयोगकर्ता दिखाएं
1> select name from sysusers; 
2> go 
name
-------------------------------------
##MS_AgentSigningCertificate##
##MS_PolicyEventProcessingLogin##
db_accessadmin
db_backupoperator
db_datareader
db_datawriter
db_ddladmin
db_denydatareader
db_denydatawriter
db_owner
db_securityadmin
dbo
guest
INFORMATION_SCHEMA
public
sys

(16 rows affected)

# वर्तमान उपयोगकर्ता दिखाएँ
1> select current_user; 
2> go 

---------------------------------------
dbo

(1 rows affected)

# छोड़ना
1> exit 
मिलान सामग्री