Files
pos-system/infra/servers/mssql.md
Ho Ngoc Hai 5c8764f63a docs(architecture): Update documentation for direct upload architecture and API endpoints
- Enhanced the architecture documentation to recommend direct upload over legacy proxy upload for improved performance and scalability.
- Added detailed comparisons of upload patterns, including throughput, memory usage, and latency.
- Updated API endpoint documentation to reflect new direct upload methods and their benefits.
- Included examples for direct upload flow and bucket directory structure to aid developers in implementation.
2026-01-13 21:17:55 +07:00

2.0 KiB

Hướng Dẫn Sử Dụng MSSQL Server 2025 (Ubuntu 24.04)

Thông Tin Cài Đặt

  • Phiên bản: Microsoft SQL Server 2025 (RTM) - Enterprise Developer Edition
  • Giấy phép: Miễn phí trọn đời (Free Forever) cho môi trường Development & Test. Không dùng cho Production.
  • Hệ điều hành: Ubuntu 24.04
  • Tài khoản mặc định: SA
  • Mật khẩu: Velik@2026

Kết Nối Database

Sử dụng sqlcmd để kết nối:

/opt/mssql-tools18/bin/sqlcmd -S localhost -U SA -P 'Velik@2026' -C

Để chạy một câu lệnh SQL đơn giản (ví dụ: kiểm tra phiên bản):

/opt/mssql-tools18/bin/sqlcmd -S localhost -U SA -P 'Velik@2026' -C -Q "SELECT @@VERSION"

Lưu ý: Cờ -C là bắt buộc để tin cậy chứng chỉ server (Trust Server Certificate) vì mặc định MSSQL tạo chứng chỉ tự ký.

Quản Lý Service

Các lệnh systemd để quản lý MSSQL Server:

  • Kiểm tra trạng thái:
    sudo systemctl status mssql-server
    
  • Khởi động:
    sudo systemctl start mssql-server
    
  • Dừng:
    sudo systemctl stop mssql-server
    
  • Khởi động lại:
    sudo systemctl restart mssql-server
    

Cấu Hình & Thư Mục

  • File cấu hình: /var/opt/mssql/mssql.conf
  • Thư mục dữ liệu (mặc định): /var/opt/mssql/data
  • Thư mục log lỗi: /var/opt/mssql/log
  • Công cụ cấu hình: /opt/mssql/bin/mssql-conf

Thay Đổi Password SA

Nếu cần đặt lại mật khẩu SA:

sudo systemctl stop mssql-server
sudo MSSQL_SA_PASSWORD='NewStrongPassword!' /opt/mssql/bin/mssql-conf -n set-sa-password
sudo systemctl start mssql-server

Thay Đổi Phiên Bản (Edition)

sudo systemctl stop mssql-server
sudo /opt/mssql/bin/mssql-conf set-edition
# Chọn phiên bản mong muốn (ví dụ: Developer)
sudo systemctl start mssql-server