🗃️ MS SQL Server Connection
Connect Microsoft SQL Server or Azure SQL to Meza AI.
Overview
Connect your Microsoft SQL Server or Azure SQL Database to Meza AI. This integration supports SQL Server 2016+ and Azure SQL Database, covering both on-premises and cloud deployments.
Prerequisites
- SQL Server 2016+ or Azure SQL Database
- SQL authentication credentials with read access
- Network access (configure firewall rules for Azure)
- TCP/IP protocol enabled (for on-premises)
Connection Steps
1
Navigate to Databases
Go to Configuration → Databases in the left sidebar.
2
Select MS SQL Server
Click Add Connection and select MS SQL Server.
3
Enter Connection Details
Fill in server hostname, port, database, username, and password.
4
Configure Encryption
Enable TLS encryption for secure connections (recommended).
5
Test & Save
Click Test Connection then Save.
Connection Parameters
| Parameter | Description | Example |
|---|---|---|
| Host | Server hostname or IP | server.database.windows.net |
| Port | SQL Server port (default: 1433) | 1433 |
| Database | Database name | myapp_production |
| Username | SQL login username | meza_readonly |
| Password | SQL login password | ******** |
| Encrypt | Enable TLS encryption | Yes |
| Trust Server Certificate | Trust self-signed certs | No |
⚠️ Warning
Always create a dedicated read-only SQL login for Meza AI.
Creating a Read-Only User
Run these T-SQL commands to create a read-only user:
-- Create a login at server level CREATE LOGIN meza_readonly WITH PASSWORD = 'YourSecurePassword123!'; -- Switch to your database USE your_database; -- Create a user for the login CREATE USER meza_readonly FOR LOGIN meza_readonly; -- Grant read-only access ALTER ROLE db_datareader ADD MEMBER meza_readonly;
Azure SQL Database
For Azure SQL Database, additional configuration is required:
Firewall Rules
- Go to your Azure SQL Server in the Azure Portal
- Click Networking under Security
- Add Meza AI IP addresses to the firewall rules:
34.102.136.180
35.247.10.205 - Click Save
Connection String Format
Azure SQL uses this hostname format:
your-server-name.database.windows.netOn-Premises SQL Server
For on-premises SQL Server installations:
- Enable TCP/IP protocol in SQL Server Configuration Manager
- Configure Windows Firewall to allow port 1433
- Enable SQL Server Authentication (mixed mode)
- Consider using an SSH tunnel for secure access
Troubleshooting
Connection Timeout
- Verify firewall rules allow Meza AI IPs
- Check that TCP/IP is enabled
- Ensure SQL Server Browser service is running (for named instances)
Login Failed
- Verify SQL authentication is enabled
- Double-check username and password
- Ensure the login is mapped to the database