# MySqlDatabaseResource

- Module: [Aspire.Hosting.MySql](/reference/api/typescript/aspire.hosting.mysql.md)
- Version: `13.2.0`
- Kind: `handle`
- Source: [GitHub](https://github.com/microsoft/aspire)

## Definition

```typescript
interface MySqlDatabaseResource
  extends IManifestExpressionProvider,
    IResource,
    IResourceWithConnectionString,
    IResourceWithParent,
    MySqlServerResource]],
    IValueProvider,
    IValueWithReferences {
  readonly connectionStringExpression: ReferenceExpression;
  readonly databaseName: string;
  readonly jdbcConnectionString: ReferenceExpression;
  readonly name: string;
  readonly parent: MySqlServerResource;
  readonly uriExpression: ReferenceExpression;
  withCreationScript(script: string): MySqlDatabaseResource;
}
```

## Properties

- `connectionStringExpression`: `ReferenceExpression` `get` -- Gets the ConnectionStringExpression property
- `databaseName`: `string` `get` -- Gets the DatabaseName property
- `jdbcConnectionString`: `ReferenceExpression` `get` -- Gets the JdbcConnectionString property
- `name`: `string` `get` -- Gets the Name property
- `parent`: [MySqlServerResource](/reference/api/typescript/aspire.hosting.mysql/mysqlserverresource.md) `get` -- Gets the Parent property
- `uriExpression`: `ReferenceExpression` `get` -- Gets the UriExpression property

## Methods

- [withCreationScript](/reference/api/typescript/aspire.hosting.mysql/mysqldatabaseresource/withcreationscript.md) -- `method` -- Defines the SQL script for database creation
    ```typescript
  withCreationScript(script: string): MySqlDatabaseResource
  ```
