CentOS Stream 8
Sponsored Link

SQL Server 2019 : Install2021/05/30

 
Install Microsoft SQL Server 2019.
Before installing and using, Read license terms below.
If you use it on production environment, it's not free, need to buy licenses.
⇒ https://www.microsoft.com/en-us/sql-server/sql-server-2019-pricing
[1] Add SQL Server 2019 Repository and Install it.
[root@dlp ~]#
curl https://packages.microsoft.com/config/rhel/8/mssql-server-2019.repo -o /etc/yum.repos.d/mssql-server-2019.repo

[root@dlp ~]#
curl https://packages.microsoft.com/config/rhel/8/prod.repo -o /etc/yum.repos.d/msprod.repo
[root@dlp ~]#
dnf -y install mssql-server mssql-tools unixODBC-devel
[2] Run initial Setup.
[root@dlp ~]#
/opt/mssql/bin/mssql-conf setup

usermod: no changes
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.

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.

# select an edition you'd like to use
Enter your edition(1-8): 2
The license terms for this product can be found in
/usr/share/doc/mssql-server or downloaded from:
https://go.microsoft.com/fwlink/?LinkId=2104294&clcid=0x409

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

# agree to the license
Do you accept the license terms? [Yes/No]:Yes

# set admin password
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 → /usr/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 (/usr/lib/systemd/system/mssql-server.service; enabled; vendo>
   Active: active (running) since Fri 2021-05-28 00:33:39 CST; 27s ago
     Docs: https://docs.microsoft.com/en-us/sql/linux
 Main PID: 26303 (sqlservr)
    Tasks: 163
   Memory: 759.0M
   CGroup: /system.slice/mssql-server.service
           +- 26303 /opt/mssql/bin/sqlservr
           +- 26325 /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] If Firewalld is running and also SQL Server is used from remote Hosts, allow service port like follows.
[root@dlp ~]#
firewall-cmd --add-port=1433/tcp --permanent

success
[root@dlp ~]#
firewall-cmd --reload

success
[4] Connect to SQL Server and verify working.
[root@dlp ~]#
sqlcmd -S localhost -U SA

Password:  
# admin password you set


# show system databases
1> select name,database_id from sys.databases; 
2> go 
name                    database_id
----------------------- -----------
master                            1
tempdb                            2
model                             3
msdb                              4

(4 rows affected)

# show system users
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)

# show current user
1> select current_user; 
2> go 

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

(1 rows affected)

# quit
1> exit 
Matched Content