MSSQL-Notes

1. ODBC Driver Install

1.1. Rocky Linux

  • Install

    1. Import Microsoft’s GPG key

      sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
    2. Add the Microsoft ODBC repo

      sudo curl -o /etc/yum.repos.d/msprod.repo https://packages.microsoft.com/config/rhel/9/prod.repo
    3. Install the ODBC driver

      sudo dnf -y install msodbcsql18
    4. Install SQL command‑line tools (sqlcmd, bcp)

      sudo dnf -y install mssql-tools18 unixODBC-devel
  • Verify

    1. Verify

      Command
      odbcinst -q -d
      Sample result
      [ODBC Driver 18 for SQL Server]
  • Test

    1. Test

      /opt/mssql-tools18/bin/sqlcmd -C -S yourserver -U youruser -P yourpassword
  • Create/Edit /etc/odbcinst.ini

    1. Edit

      vi /etc/odbcinst.ini