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

# Connecting To MySQL

>  Guide to connecting Genesis Bots to MySQL.

### \[OPTIONAL] Install MySQL locally

if needed, you can install MySQL locally [here](https://dev.mysql.com/doc/mysql-installation-excerpt/5.7/en/)

**1. Installing on MacOS**

To install on MacOS, you can use Brew

```
brew install mysql
```

**2. Start MySQL**

Then to start MySQL, use

```bash theme={null}
brew services start mysql
```

> [!NOTE]
>
> **NOTE:** If you are connecting to a remote MySQL instance that is already running, you shouldn’t need to uninstall it locally.

If you have installed locally using defaults, you will have MySQL running with these configuration properties:

```
	Host: localhost
	Port: 3306
	User: root
	Password:  <empty, no password>
```

## Add A Connection To MySQL

Tell Eve you want to connect to MySQL, and provide your host, port, user, and password

**Copy the prompt below to follow along**

```
Eve, add a connection to MySQL called “mysql_demo”, host: localhost, port: 3306, user: root, and the password is “” (no password needed), and allow all bots to access it.
```

![](https://mintcdn.com/genesiscomputing/PlA8kGWE_2jPvMVf/images/MySQL-1.png?fit=max\&auto=format\&n=PlA8kGWE_2jPvMVf\&q=85\&s=3cc29bc70bf07e2a2c268f1e38914624)

Eve adding a database connection to MySQL

Clicking “**Database Connections**” in the Genesis GUI will show you that it has been added

![](https://mintcdn.com/genesiscomputing/PlA8kGWE_2jPvMVf/images/DatabaseConnectionsGUI.png?fit=max\&auto=format\&n=PlA8kGWE_2jPvMVf\&q=85\&s=2ad3b4538d1829efca829958dda29651)

Click Database Connections

![](https://mintcdn.com/genesiscomputing/PlA8kGWE_2jPvMVf/images/MySQL-2.png?fit=max\&auto=format\&n=PlA8kGWE_2jPvMVf\&q=85\&s=1ab2112a0c692d45521b14d6ff95bdee)

mysql\_demo and other databases connected appear here

### \[OPTIONAL] Create Sample Data

If you already have data in MySQL, you can proceed to the next section to harvest and analyze your data.  If your MySQL is empty, you can have Eve create some sample data for you

**Copy the prompt below to follow along**

```
Create a demo database in this new connection called PETS, with tables DOGS and CATS. Add several columns to each database to track data about the respective types of pets names, breeds, etc. Then insert 5 sample rows in each table.
```

![](https://mintcdn.com/genesiscomputing/PlA8kGWE_2jPvMVf/images/MySQL-3.png?fit=max\&auto=format\&n=PlA8kGWE_2jPvMVf\&q=85\&s=0f69cd656f24b2616055c37d8d43c674)

Eve creates synthetic data for you to use

> [!NOTE]
>
> **NOTE:** It’s ok if Eve has to retry some steps or if she encounters issues, she should be able to resolve them on her own.

Once your data is created, you can ask Eve to show you some of it.

**Copy the prompt below to follow along**

```
Show me 3 rows from dogs and 3 rows from cats
```

![](https://mintcdn.com/genesiscomputing/PlA8kGWE_2jPvMVf/images/MySQL-4.png?fit=max\&auto=format\&n=PlA8kGWE_2jPvMVf\&q=85\&s=e3bdc0d44365ab1e5781c14e76d734b0)

Eve showing the first 3 rows of the newly created synthetic dataset

## Adding MySQL To The Harvest

Tell Eve to add your MySQL connection and the databases you want to use to the harvest.

**Example:** if you just created the databases above

**Copy the prompt below to follow along**

```
Add the PETS database from the msql_demo connection to the harvest.
```

![](https://mintcdn.com/genesiscomputing/PlA8kGWE_2jPvMVf/images/MySQL-5.png?fit=max\&auto=format\&n=PlA8kGWE_2jPvMVf\&q=85\&s=ef2577a352ee9e3b1ed04c791105c6fd)

Eve adds the new PETS database from the prompt above

After a few minutes, you should see the result on the Configuration / Harvest Summary screen

![](https://mintcdn.com/genesiscomputing/PlA8kGWE_2jPvMVf/images/MySQL-6.png?fit=max\&auto=format\&n=PlA8kGWE_2jPvMVf\&q=85\&s=350219f0799c7305c0397824d26cb97c)

Harvester Status is where you can see all of the data sources being harvested

You can ask Eve questions about your data in MySQL once the database connection appears on the Harvester Status page.

**Copy the prompt below to follow along**

```
Search mysql for data on pets, and show me how many of each kind of pet I have.
```

![](https://mintcdn.com/genesiscomputing/PlA8kGWE_2jPvMVf/images/MySQL-7.png?fit=max\&auto=format\&n=PlA8kGWE_2jPvMVf\&q=85\&s=4a28d8e8794981118f61cdc67c928d37)

Eve shows a breakdown of the pets in the database

## Removing The Connection

 You also have the option to remove the connection.&#x20;

> [!WARNING]
>
> **NOTE:** This will also remove related harvest information

**Copy the prompt below to follow along**

```
remove the connection to the PETS data
```
