> ## Documentation Index
> Fetch the complete documentation index at: https://www.integrate.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# ELT/CDC: Sources - MySQL - Self-hosted MySQL

> Configure a self-hosted MySQL server as a source in Integrate.io ELT & CDC. Set up binary log replication from your on-premises MySQL database.

## Create user

Create a sync user for Integrate.io by executing,

```bash theme={null}
CREATE USER 'flydata'@'%' IDENTIFIED BY '<your_password>';
```

Grant necessary privileges,

```sql theme={null}
GRANT SELECT, RELOAD, REPLICATION SLAVE, REPLICATION CLIENT, LOCK TABLES ON *.* TO 'flydata'@'%';
FLUSH PRIVILEGES;
```

## Enable binary logging

Set the following properties in the MySQL configuration file (typically available in the `/etc/mysql/` directory).

```ini theme={null}
[mysqld]
log_bin = mysql-bin
binlog_format = ROW
binlog_expire_logs_seconds = 604800
binlog_row_image = FULL
net_read_timeout = 3600
net_write_timeout = 3600
wait_timeout = 86400
```

Confirm your changes by checking the binlog status,

```sql theme={null}
SHOW GLOBAL VARIABLES LIKE 'log_bin';
```
