- Newest
- Most votes
- Most comments
From what I can tell, Microsoft does not have official ODBC packages for AL20203. There is a open feature request in AL2023 GitHub.
You can try installing driver for RHEL 9. Just be aware that there is no support.
From Install the Microsoft ODBC driver for SQL Server (Linux)
curl https://packages.microsoft.com/config/rhel/9/prod.repo | sudo tee /etc/yum.repos.d/mssql-release.repo
sudo dnf remove -q -y unixODBC-utf16 unixODBC-utf16-devel #to avoid conflicts
sudo ACCEPT_EULA=Y yum install -y msodbcsql18
sudo ACCEPT_EULA=Y yum install -y mssql-tools18
To install the Microsoft SQL Server ODBC driver on Amazon Linux 2023, you need to follow a different approach than the standard Microsoft documentation since Amazon Linux 2023 has specific requirements.
For Amazon Linux 2023, you'll need to:
- Install the required dependencies first:
sudo dnf install php-odbc unixODBC-devel -y
- Then install the SQL Server drivers using PECL:
sudo pecl install sqlsrv
sudo tee /etc/php.d/20-sqlsrv.ini > /dev/null << EOF
extension=sqlsrv.so
EOF
sudo pecl install pdo_sqlsrv
sudo tee /etc/php.d/30-pdo_sqlsrv.ini > /dev/null << EOF
extension=pdo_sqlsrv.so
EOF
The issue you're encountering is common because Amazon Linux 2023's repository structure differs from RHEL, even though they share some similarities. The standard Microsoft installation scripts are designed primarily for Ubuntu and RHEL distributions, not specifically for Amazon Linux 2023.
If you're trying to install the Microsoft ODBC driver for connecting to SQL Server from other applications (not PHP), you might need to download the appropriate package directly from Microsoft's repositories and install it manually, ensuring you select the correct version compatible with Amazon Linux 2023.
Sources
Using/Installing Microsoft SQL Server Driver in Amazon Linux 2023 | AWS re:Post
Deploy ec2 AMI with sql 2022 web edition - amazon linux based | AWS re:Post
answered a year ago
Relevant content
asked 3 years ago
- AWS OFFICIALUpdated a month ago
- AWS OFFICIALUpdated 2 years ago

In my case, I need to access the SQL Server from a non-PHP application so the above suggestions don't apply for me. I've tried researching what exactly needs to be manually downloaded/installed and none of the answers are clear enough, or the commands that I run still can't install it successfully.