Database Connection
Connect LILA to your database. This page shows you how to set up the database connection that powers your AI assistant. Once connected, LILA can translate natural language questions into SQL queries and return results from your actual data.
Navigation: Dashboard → Select Project → Database Connection
Supported Databases
LILA connects to the following database types:
- PostgreSQL
- MySQL
- MariaDB
- MSSQL (Microsoft SQL Server)
Connection Fields
Required Fields
Database Type: Select your database system from the dropdown
Host: The hostname or IP address of your database server (e.g., localhost, db.example.com, 192.168.1.100)
Port: The port number your database listens on (default ports: PostgreSQL 5432, MySQL 3306, MSSQL 1433)
Database Name: The name of the database to connect to
Username: Database user with read access (recommended: create a read-only user for security)
Password: Password for the database user
Optional Fields
Schema: For databases that support schemas (PostgreSQL), specify which schema to use
Create or Update Connection
First-Time Setup: If you haven’t configured a database connection yet, the page will show empty fields and a “Create Connection” button.
Updating Existing Connection: If you already have a connection configured, the page will load your current settings. Make your changes and click “Update Connection” to save.
Save Button States:
- Disabled when no changes have been made
- Shows “Creating…” or “Updating…” while saving
- Displays success message when saved
Deleted Project Recovery
If you try to create a connection with database credentials that were previously used in a deleted project, LILA will offer to restore that project instead of creating a duplicate.
Why This Happens: LILA prevents multiple projects from using the same database on the free tier to prevent abuse.
What You Can Do:
- Restore the deleted project to recover your previous configuration
- Or use different database credentials to create a fresh project
Security Best Practices
Safe to connect LILA to your production database when you follow these practices.
Read-Only Access: Create a database user with SELECT-only permissions for LILA. This prevents the AI from accidentally modifying your data.
Network Security: Ensure your database firewall rules allow connections from LILA’s IP address.
Encrypted Credentials: All database passwords are encrypted before storage.
Limited Scope: Only grant access to the specific database or schema that LILA needs to query.
What Happens After Setup
After connecting your database, proceed to the next steps. Once you save your database connection:
- LILA tests the connection to verify it works
- Your credentials are encrypted and stored securely
- You can proceed to the next step: Schema Upload
- The Widget and API will use these credentials to execute queries
Related Pages
- Schema Upload - Upload your database schema after configuring the connection
- Playground - Test queries after setup is complete
- Projects Overview - Manage multiple projects with different databases