# Creating a metadata definition from a database

In Talend Studio, you can fetch a metadata definition from a database, making the best use of your existing resources.

## Before you begin

This tutorial makes use of a database. If you do not have a database, download and extract the following file: [customers_unordered.zip](https://help.qlik.com/talend/en-US/creating-using-metadata-talend-studio/8.0/Content/Resources/attachments/customers_unordered.zip). You must import the database into a compatible program.

## Procedure

1. In the Repository, expand Metadata then right-click Db Connections and click Create connection.

   You are brought to Step 1 in the wizard.
2. In the Name field, enter a name.
   ### Example

   MySQL
3. Optional: In the Purpose field, enter a purpose.
   ### Example

   Demonstrate how to fetch metadata from a database
4. Optional: In the Description field, enter a description.
   ### Example

   Fetching CSV data imported into a MySQL database

   Information noteTip: Enter a Purpose and Description to stay organized.
5. Click Next.

   You are brought to Step 2 in the wizard.
6. Enter your connection details.

   Information noteTip: To check the connection to the database, click Test connection.
7. Click Finish.

   You are brought to the Designer.
8. Right-click your metadata in the Repository.
   1. Click Retrieve Schema.

      You are brought to the Filter for the Table window.
   2. Click Next.

      You are brought to the Add a Schema on repository window.
   3. Select the check box next to the table name.
   4. Click Next.

      The database schema displays.
   5. Optional: Change the Schema parameters.
   6. Click Finish.

## Results

All table schemas have been imported as metadata and can be reused in your components.