> For the complete documentation index, see [llms.txt](https://datasherlock.gitbook.io/datasherlock/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://datasherlock.gitbook.io/datasherlock/introductions/getting-started.md).

# Getting Started

### Run Employees Database (Optional) <a href="#create-agent" id="create-agent"></a>

{% tabs %}
{% tab title="MySQL" %}

```
docker run -d \                                                                                                         
  --name mysql-employees \
  -p 3306:3306 \
  -e MYSQL_ROOT_PASSWORD=root \
  -v $PWD/data:/var/lib/mysql \
  genschsa/mysql-employees
```

{% endtab %}

{% tab title="Postgres" %}

```
docker run -d --name postgres \
  -p 5432:5432 \
  -e POSTGRES_USER=root \
  -e POSTGRES_PASSWORD=root \
  -e POSTGRES_DB=employees \
  -v "$(pwd)/data:/var/lib/postgresql/data" \
  postgres:13.2-alpine
```

{% endtab %}

{% tab title="MsSQL" %}

```
docker run -p 14330:1433 -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=root' -d chriseaton/adventureworks:latest
```

{% endtab %}
{% endtabs %}

### Create Agent <a href="#create-agent" id="create-agent"></a>

<figure><img src="https://datasherlock.io/assets/images/main.gif" alt=""><figcaption></figcaption></figure>

**NOTE:** On Catalog page will will see API Keys, Each API keys are tightly coupled with agent.&#x20;

### Export Environments  variables <a href="#export-env-variables" id="export-env-variables"></a>

<pre class="language-bash"><code class="lang-bash">export DS_API_KEY=****
<strong>export DB_PASSWORD=root
</strong></code></pre>

### Register Database Metadata in the Cloud <a href="#register-database-metadata-in-the-cloud" id="register-database-metadata-in-the-cloud"></a>

You can register your database's metadata with Datasherlock. Below is an example configuration for MySQL:

{% tabs %}
{% tab title="MySQL" %}

<pre><code><strong>type: "mysql"
</strong>database:
  host: "127.0.0.1"
  username: "root"
  port: 3306
  database: "employees"
  ssl: false
</code></pre>

{% endtab %}

{% tab title="Postgres" %}

```
type: "postgres"
database:
  host: "127.0.0.1"
  username: "root"
  port: 5432
  database: "employees"
  ssl: disable
```

{% endtab %}

{% tab title="MsSQL" %}

<pre><code><strong>type: "mssql"
</strong>database:
  host: "127.0.0.1"
  username: "root"
  port: 14330
  database: "master"
</code></pre>

{% endtab %}
{% endtabs %}

To connect your agent to the Datasherlock cloud, use the following command. It will register your database schema with cloud

```bash
sherlock register --config config.yaml -n <AGENT_NAME>
```

### Run an Agent Locally <a href="#run-an-agent-locally" id="run-an-agent-locally"></a>

To run an API server locally on port 8080, use the following command. You can then use this URL to interact with the platform:

```bash
sherlock serve --config config.yaml
```
