> For the complete documentation index, see [llms.txt](https://docs.euno.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.euno.ai/sources/data-warehouses/mysql-integration.md).

# MySQL

Euno's MySQL integration supports auto-discovery of:

* MySQL instances
* MySQL schemas (databases)
* MySQL tables and views
* MySQL columns with data type mapping
* View definitions with SQL code

## Setting up MySQL integration

### Overview

MySQL is a popular open-source relational database management system. In MySQL, data is stored in *tables* and *views.* Each table or view belongs to one MySQL *schema* (also called database), and each *schema* belongs to a MySQL *instance*. A MySQL instance can have multiple schemas, and each schema can contain multiple tables and views.

To discover MySQL resources, Euno connects directly to your MySQL instance and executes queries on the system-defined `INFORMATION_SCHEMA` views. These views provide metadata about all databases, tables, views, and columns in your MySQL instance.

Euno automatically excludes system schemas (`mysql`, `sys`, `performance_schema`, `information_schema`) and allows you to configure which user schemas to discover using regular expression patterns.

### Step 1: Prepare MySQL Instance

#### Ensure MySQL is accessible

1. Verify that your MySQL instance is running and accessible from each of Euno's public IP addresses:
   * `35.224.29.172`
   * `44.218.99.77`
   * `3.214.77.39`
2. Note the MySQL hostname/IP address and port (default: 3306)
3. Ensure your MySQL instance allows connections from Euno's network

#### Create a dedicated MySQL user for Euno (Recommended)

For security best practices, create a dedicated MySQL user with minimal required permissions:

```sql
-- Create a dedicated user for Euno
CREATE USER 'euno_reader'@'%' IDENTIFIED BY 'secure_password_here';

-- Grant necessary permissions to read metadata
GRANT SELECT ON *.* TO 'euno_reader'@'%';
GRANT SHOW DATABASES ON *.* TO 'euno_reader'@'%';

-- Apply the changes
FLUSH PRIVILEGES;
```

**Alternative**: You can use an existing MySQL user with read permissions, but ensure it has the following minimum privileges:

* `SELECT` on all databases you want to discover
* `SHOW DATABASES` privilege

#### Optional usage collection

To collect 14/30/60-day query and user counts, enable **Extract Usage Metrics** under Advanced. The MySQL administrator must enable the required Performance Schema consumers and statement instruments and grant the Euno user access to the usage and configuration tables. User windows require `events_statements_history_long`, which is disabled by default in MySQL 8.4.

See [MySQL Usage Data](/using-euno/usage-optimization/mysql-usage-data.md) for the permissions, configuration SQL, and retention limits. Enabling collection does not backfill history.

#### Optional query-history lineage

To infer table lineage from `INSERT ... SELECT` and `CREATE TABLE ... SELECT` history, enable **Extract Query History Lineage** under Advanced. Euno prefers Performance Schema statement digests and falls back to `events_statements_history_long` when digest rows are empty or unavailable. This option uses the same Performance Schema `SELECT` grants as usage collection.

#### Optional indexes and constraints

To publish indexes, primary keys, unique constraints, check constraints, and foreign-key lineage, enable **Extract Indexes and Constraints** under Advanced. This reads `INFORMATION_SCHEMA` and does not require Performance Schema. On MySQL versions before 8.0.16, check-constraint clause text may be omitted; indexes, primary keys, unique constraints, and foreign keys are still published.

### Step 2: Configure Euno's MySQL Integration

| Configuration  | Description                                         |
| -------------- | --------------------------------------------------- |
| MySQL Hostname | The hostname or IP address of your MySQL server     |
| MySQL Port     | The port number MySQL is running on (default: 3306) |
| MySQL Username | Username for connecting to MySQL                    |
| MySQL Password | Password for the MySQL user                         |

### Step 3: Schedule

* Enable the Schedule option.
* Choose:
  1. **Weekly**: Set specific days and times.
  2. **Hourly**: Define the interval in hours (e.g., every 8 hours).

### Step 4: Resource Cleanup

* **Immediate Cleanup**: Remove resources not detected in the most recent successful source integration run.
* **No Cleanup**: Keep all resources indefinitely, even if they are no longer detected.

To keep your data relevant and free of outdated resources, Euno provides automatic **resource cleanup** options. These settings determine when a resource should be removed if it is no longer detected by a source integration. For a detailed explanation on Euno's cleanup strategies, see: [Resource Sponsorship in Euno](/developer-reference/technical-concepts/resource-sponsorship-and-cleanup-in-euno.md).

### Step 5: Advanced Settings

Click on the '**Advanced**' section to display these additional configurations.

| Configuration                    | Description                                                                                                                                                                                                                  |
| -------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Override MySQL Instance Name     | Custom name for the MySQL instance in Euno (defaults to hostname)                                                                                                                                                            |
| Override MySQL Hostname for URIs | Custom hostname to use in resource URIs (defaults to actual hostname)                                                                                                                                                        |
| Extract Query History Lineage    | Infer table lineage from Performance Schema `INSERT ... SELECT` and `CREATE TABLE ... SELECT` history. Disabled by default. Digest is preferred; empty or unavailable digest falls back to `events_statements_history_long`. |
| Extract Usage Metrics            | Collect available query and distinct-user counts from Performance Schema. Disabled by default. See [MySQL Usage Data](/using-euno/usage-optimization/mysql-usage-data.md) for prerequisites and coverage limits.             |
| Extract Indexes and Constraints  | Discover indexes, constraints, and foreign-key table dependencies. Disabled by default.                                                                                                                                      |
| Schema Pattern                   | Use a regular expression to allow or exclude specific schemas. ".\*" will include/exclude all schemas. System schemas (mysql, sys, performance\_schema, information\_schema) are always excluded regardless of this setting. |
| Local Agent                      | Select a local agent to route traffic through when your MySQL instance is inside a private network. See [Local Agents](/setup-configuration/account-settings/local-agents.md) for setup instructions.                        |

**Credentials from a local agent:** when a local agent is selected, the MySQL username and password can be fetched from your own secret store at connection time instead of being stored in Euno — pick a handle in the **from agent** dropdowns under Advanced. See [Local Agents — secret handles](/setup-configuration/account-settings/local-agents.md#fetching-credentials-from-your-vault-secret-handles).

**Examples of Schema Patterns:**

* `.*` - Include all user schemas
* `production_.*` - Include only schemas starting with "production\_"
* `.*` (allow) and `test_.*` (deny) - Include all schemas except those starting with "test\_"

### Step 6: Save Configuration

Click the **Test & Save** button to complete the setup. Euno will validate the connection and permissions before saving.

## Discovered Resources

The Euno-MySQL integration discovers various resources including MySQL instances, schemas, tables, views, and columns. For detailed information about discovered resources and their properties, see [mysql-integration-discovered-resources](/sources/data-warehouses/mysql-integration/mysql-integration-discovered-resources.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.euno.ai/sources/data-warehouses/mysql-integration.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
