RHEL BasedRocky Linux

How To Install Microsoft SQL Server on Rocky Linux 10

Install Microsoft SQL Server on Rocky Linux 10

Microsoft SQL Server’s expansion into Linux environments has revolutionized database management for enterprise organizations. Rocky Linux 10, as a stable enterprise-grade distribution, provides an excellent foundation for running SQL Server workloads. This comprehensive guide walks through every aspect of installing and configuring Microsoft SQL Server on Rocky Linux 10.

The combination of SQL Server’s robust database capabilities with Rocky Linux’s enterprise stability offers significant advantages over traditional Windows-based deployments. Organizations benefit from reduced licensing costs, enhanced security, and improved resource utilization. Whether you’re migrating existing databases or implementing new solutions, this installation process ensures optimal performance and reliability.

This guide covers complete installation procedures, configuration optimization, security hardening, and troubleshooting strategies. System administrators, database professionals, and Linux enthusiasts will find detailed instructions for successful SQL Server deployment. The step-by-step approach eliminates guesswork while providing professional-grade implementation standards.

Prerequisites and System Requirements

Hardware Requirements

Before beginning the SQL Server installation on Rocky Linux 10, verify your system meets minimum hardware specifications. Memory requirements demand at least 2 GB RAM, though production environments should allocate 3 GB or more for optimal performance. Database workloads consume significant memory resources, making adequate RAM allocation critical for responsive operations.

Processor specifications require x64-compatible architecture with minimum 2 GHz clock speeds. Multi-core processors enhance SQL Server performance significantly. Dual-core configurations represent the absolute minimum, while quad-core or higher processors deliver superior database processing capabilities. Production deployments benefit from enterprise-grade processors with multiple cores and high cache memory.

Storage requirements mandate 6 GB available disk space for basic installation. Production databases require substantially more storage capacity. The file system must utilize XFS or ext4 formats, as BTRFS remains unsupported. Storage performance directly impacts database operations, making SSD storage highly recommended for production environments.

Network connectivity enables package downloads and repository access during installation. Reliable internet connections ensure smooth installation processes without interruption. Consider bandwidth requirements for downloading SQL Server packages and dependencies.

Software Prerequisites

Rocky Linux 10 installation requires administrator privileges through sudo access. System packages must be current before beginning SQL Server installation. Execute sudo dnf update to ensure all system components are up-to-date. This prevents compatibility issues and security vulnerabilities during the installation process.

Internet connectivity remains essential for accessing Microsoft repositories and downloading required packages. Firewall configurations may require adjustment to permit repository access. Basic command-line familiarity streamlines the installation process, though detailed instructions accommodate various skill levels.

SELinux considerations affect SQL Server functionality on Rocky Linux systems. Understanding security contexts and policy implications ensures proper service operation. Default SELinux configurations may require modification for optimal SQL Server performance.

Available SQL Server Editions and Licensing

Microsoft offers multiple SQL Server editions tailored to different use cases and budgets. The Evaluation Edition provides 180-day free access to full SQL Server functionality without production rights. This edition enables comprehensive testing and development activities before committing to paid licensing.

Developer Edition delivers complete SQL Server features at no cost for development and testing purposes. Production deployment restrictions apply, making this edition unsuitable for live environments. Database developers and testing teams benefit from full enterprise capabilities without licensing expenses.

Express Edition offers free SQL Server functionality with specific limitations. Database size restrictions cap storage at 10 GB per database. Memory utilization limits to 1 GB RAM, while processor usage restricts to single socket and four cores maximum. Small applications and development projects often find Express Edition sufficient.

Web Edition targets web application hosting scenarios with licensing optimized for internet-facing databases. Standard Edition provides comprehensive functionality for small to medium business requirements. Enterprise Edition delivers complete feature sets including advanced analytics, reporting services, and high availability solutions.

Licensing compliance requires careful consideration of deployment scenarios and user access patterns. Production environments must maintain proper licensing documentation and usage tracking. Consult Microsoft licensing specialists for complex deployment requirements.

Step-by-Step Installation Process

Adding Microsoft SQL Server Repository

Repository configuration enables package manager access to official Microsoft SQL Server packages. Begin by importing Microsoft’s GPG key for package verification and security validation. This cryptographic key ensures package authenticity and prevents unauthorized modifications.

Execute the following command to add the Microsoft SQL Server repository:

sudo curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/8/mssql-server-2022.repo

This command downloads the repository configuration file and places it in the appropriate directory. The repository file contains package source information and authentication details. Rocky Linux 10 utilizes RHEL 8 repository compatibility for Microsoft packages.

Verify repository addition by listing available repositories:

sudo dnf repolist

The output should display the newly added Microsoft SQL Server repository among available package sources. Repository addition enables access to SQL Server packages and related dependencies through the standard package manager.

Repository structure includes multiple package versions and update channels. The main repository contains stable release packages while update channels provide cumulative updates and security patches. Understanding repository organization helps with package selection and update management.

Installing SQL Server Database Engine

Package installation utilizes the DNF package manager for downloading and configuring SQL Server components. The installation process handles dependency resolution automatically, ensuring all required libraries and components are present.

Install SQL Server using the following command:

sudo dnf install mssql-server

DNF downloads the SQL Server package and its dependencies from the Microsoft repository. Package size typically ranges from 200-300 MB depending on included components. Installation progress displays download status and dependency resolution information.

During installation, GPG key confirmation prompts may appear. Accept the Microsoft GPG key to proceed with package installation. This verification step ensures package authenticity and security compliance.

Monitor installation progress through terminal output messages. Successful installation creates the SQL Server directory structure under /opt/mssql/. Package contents include the database engine, configuration utilities, and startup scripts.

Verify installation completion by checking installed package information:

rpm -qi mssql-server

This command displays detailed package information including version number, installation date, and file locations. Package verification confirms successful installation before proceeding to configuration steps.

Initial SQL Server Configuration

Configuration setup initializes SQL Server with essential settings and security parameters. The setup wizard guides through edition selection, password configuration, and license acceptance. This interactive process ensures proper initial configuration.

Launch the configuration wizard:

sudo /opt/mssql/bin/mssql-conf setup

The setup wizard presents an interactive menu for edition selection. Choose the appropriate edition based on licensing requirements and intended use. Evaluation and Developer editions provide full functionality for non-production environments.

System Administrator (SA) password configuration requires strong password policies. Password requirements include minimum length, complexity rules, and character diversity. Strong passwords protect against unauthorized access and security breaches.

Password policy enforcement includes:

  • Minimum 8 characters length
  • Mixed case letters (upper and lower)
  • Numeric digits
  • Special characters
  • No dictionary words or common patterns

License terms acceptance completes the legal requirements for SQL Server usage. Read and accept Microsoft license agreements and privacy statements. License compliance ensures legal operation and support availability.

Configuration file creation stores setup parameters in /var/opt/mssql/mssql.conf. This file contains database engine settings, memory allocation, and operational parameters. Advanced configuration modifications utilize this file for custom settings.

Installing SQL Server Command-Line Tools

Adding SQL Tools Repository

Command-line tools provide essential database management capabilities through terminal interfaces. The sqlcmd utility enables SQL query execution and administrative tasks. BCP (Bulk Copy Program) facilitates large-scale data import and export operations.

Add the Microsoft SQL Tools repository:

sudo curl -o /etc/yum.repos.d/msprod.repo https://packages.microsoft.com/config/rhel/8/prod.repo

This repository contains SQL Server command-line utilities and ODBC drivers. Repository addition enables installation of essential database management tools through the package manager.

Verify repository availability:

sudo dnf repolist | grep msprod

Successful repository addition displays the Microsoft production repository in the available sources list.

Installing SQL Tools and ODBC Driver

Tool installation includes command-line utilities and database connectivity drivers. The installation process requires license agreement acceptance for Microsoft SQL Tools.

Install SQL Server tools and ODBC driver:

sudo dnf install mssql-tools unixODBC-devel

License agreement prompts appear during installation. Accept the license terms to proceed with tool installation. The EULA acceptance enables legal usage of Microsoft command-line utilities.

Installation creates executable files in /opt/mssql-tools/bin/. These utilities require PATH environment variable configuration for convenient access. Without PATH configuration, tools require full path specification for execution.

Configure system PATH for easy tool access:

echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
source ~/.bashrc

PATH configuration enables direct tool execution without full path specification. The bashrc file ensures PATH settings persist across login sessions.

Verify tool installation and accessibility:

sqlcmd -?
bcp -?

These commands display help information for each utility, confirming successful installation and PATH configuration.

Service Management and Verification

SQL Server operates as a system service requiring proper startup and management procedures. Service management ensures reliable database operation and automatic recovery after system restarts.

Start the SQL Server service:

sudo systemctl start mssql-server

Service startup initializes the database engine and begins listening for client connections. Initial startup may take several minutes as the system performs database recovery and initialization procedures.

Enable automatic service startup:

sudo systemctl enable mssql-server

Automatic startup ensures SQL Server begins operation after system boots. This configuration maintains database availability without manual intervention.

Check service status and health:

systemctl status mssql-server

Status output displays service state, process information, and recent log entries. Active status indicates successful service operation. Failed status requires troubleshooting and error resolution.

Service dependencies include network services and file system mounting. SQL Server waits for required dependencies before starting. Understanding service dependencies helps with troubleshooting startup issues.

Log file monitoring provides insights into service operation and potential issues. SQL Server logs reside in /var/opt/mssql/log/ directory. The errorlog file contains startup messages, warnings, and error information.

Network Configuration and Security

Firewall Configuration

Network security requires careful firewall configuration to balance accessibility with protection. SQL Server utilizes TCP port 1433 for client connections by default. Firewall rules must permit this port for database connectivity.

Open SQL Server port in the firewall:

sudo firewall-cmd --zone=public --add-port=1433/tcp --permanent

Permanent firewall rules persist across system restarts. The public zone applies to all network interfaces unless specifically configured otherwise.

Reload firewall configuration to activate new rules:

sudo firewall-cmd --reload

Rule activation makes the port accessible for SQL Server connections. Verify firewall configuration after reloading rules.

List active firewall rules:

sudo firewall-cmd --list-all

Output displays all active rules including the newly added SQL Server port. Firewall verification ensures proper network access configuration.

SELinux Considerations

Security-Enhanced Linux (SELinux) provides mandatory access controls affecting SQL Server operation. Proper SELinux configuration ensures security compliance while maintaining database functionality.

Install SQL Server SELinux policies:

sudo yum install -y mssql-server-selinux

SELinux policies define permitted operations and resource access for SQL Server processes. Custom policies accommodate SQL Server’s unique requirements while maintaining system security.

SELinux operates in enforcing, permissive, or disabled modes. Enforcing mode provides maximum security but may restrict SQL Server functionality without proper policies. Permissive mode logs violations without blocking operations.

Check current SELinux status:

sestatus

SELinux configuration affects file permissions, network access, and process execution. Understanding SELinux contexts helps troubleshoot permission-related issues.

Testing the Installation

Installation verification ensures SQL Server operates correctly and accepts client connections. Testing procedures validate core functionality before proceeding with production configuration.

Connect to SQL Server using sqlcmd:

sqlcmd -S localhost -U SA -P 'YourPassword'

Replace ‘YourPassword’ with the actual SA password configured during setup. Successful connection displays the sqlcmd prompt indicating ready status.

Execute a basic query to verify functionality:

SELECT @@VERSION
GO

Version query output displays SQL Server edition, version number, and build information. This information confirms successful installation and identifies the specific SQL Server release.

Test database operations with basic commands:

CREATE DATABASE TestDB
GO
USE TestDB
GO
CREATE TABLE TestTable (ID INT, Name VARCHAR(50))
GO
INSERT INTO TestTable VALUES (1, 'Test Record')
GO
SELECT * FROM TestTable
GO

These commands create a test database, table, and record. Successful execution confirms database engine functionality and storage capabilities.

Connection troubleshooting addresses common connectivity issues. Network connectivity, firewall configuration, and service status affect client connections. Error messages provide diagnostic information for resolving connection problems.

Post-Installation Configuration and Optimization

Memory Configuration

Memory allocation significantly impacts SQL Server performance and system stability. Default memory settings may not optimize performance for specific workloads or system configurations.

Configure maximum server memory:

sudo /opt/mssql/bin/mssql-conf set memory.memorylimitmb 4096

This command limits SQL Server memory usage to 4 GB. Adjust the value based on available system memory and other application requirements. Reserve adequate memory for the operating system and other services.

Memory configuration requires service restart to take effect:

sudo systemctl restart mssql-server

Monitor memory usage after configuration changes. SQL Server gradually allocates memory based on workload requirements up to the configured limit.

Additional Configuration Options

SQL Server Agent provides job scheduling and automation capabilities. Enable SQL Server Agent for production environments requiring automated maintenance tasks.

Enable SQL Server Agent:

sudo /opt/mssql/bin/mssql-conf set sqlagent.enabled true
sudo systemctl restart mssql-server

Agent functionality includes backup scheduling, maintenance plans, and alert notifications. Production environments benefit from automated administrative tasks.

Database backup configurations ensure data protection and recovery capabilities. Implement regular backup schedules for critical databases. Backup strategies should include full, differential, and transaction log backups.

Performance tuning involves multiple configuration parameters affecting query execution, memory usage, and I/O operations. Monitor system performance and adjust settings based on workload characteristics.

Common Troubleshooting Issues

Rocky Linux 10 Specific Issues

Rocky Linux 10 compatibility with SQL Server may present unique challenges requiring specific solutions. Version compatibility issues can cause installation failures or runtime problems.

Segmentation fault errors occasionally occur on newer Rocky Linux versions. These errors typically result from library incompatibilities or missing dependencies. Solution involves updating system packages and installing compatibility libraries.

Package dependency conflicts may arise during installation. Resolve conflicts by updating the package database and installing missing dependencies manually. DNF provides dependency resolution tools for complex situations.

SELinux policy conflicts can prevent SQL Server startup or normal operation. Audit SELinux logs for policy violations and install appropriate policy packages. Custom SELinux policies may be necessary for specific configurations.

General Installation Problems

Service startup failures indicate configuration or dependency issues. Examine SQL Server error logs for detailed diagnostic information. Common causes include insufficient memory, disk space, or permission problems.

Network connectivity issues affect repository access and package downloads. Verify internet connectivity and DNS resolution. Proxy configurations may require adjustment for repository access.

Permission and ownership problems prevent SQL Server from accessing required files and directories. Ensure proper ownership and permissions for SQL Server directories and files. The mssql user account requires appropriate access rights.

Database engine initialization errors occur during first startup. These errors often relate to insufficient disk space, memory limitations, or corrupted installation files. Reinstallation may be necessary for severe initialization problems.

Maintenance and Updates

Regular maintenance ensures optimal SQL Server performance and security. Microsoft releases cumulative updates containing bug fixes and security patches. Implement update procedures for production environments.

Update SQL Server packages:

sudo yum update mssql-server

Cumulative updates include important security fixes and functionality improvements. Test updates in development environments before applying to production systems.

Backup procedures should precede major updates. Database backups enable recovery if update procedures encounter problems. Document update procedures and rollback plans for production environments.

Monitor Microsoft security bulletins and update notifications. Critical security updates require immediate attention. Establish update schedules balancing security requirements with system stability.

Version management involves tracking installed versions and available updates. Maintain documentation of installed versions and update history. This information assists with troubleshooting and support requests.

SQL Tools and ODBC drivers require separate update procedures. Keep client tools synchronized with database engine versions for optimal compatibility and functionality.

Congratulations! You have successfully installed Microsoft SQL. Thanks for using this tutorial for installing the Microsoft SQL Server on your Rocky Linux 10 system. For additional or useful information, we recommend you check the official Microsoft website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is an experienced Linux enthusiast and technical writer with a passion for open-source software. With years of hands-on experience in various Linux distributions, r00t has developed a deep understanding of the Linux ecosystem and its powerful tools. He holds certifications in SCE and has contributed to several open-source projects. r00t is dedicated to sharing her knowledge and expertise through well-researched and informative articles, helping others navigate the world of Linux with confidence.
Back to top button