# MySqlDatabaseResource

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

A resource that represents a MySQL database. This is a child resource of a `MySqlServerResource`.

## Definition

```go
type MySqlDatabaseResource interface {
    ExpressionValue
    Resource
    ResourceWithConnectionString
    ResourceWithParent
}
```

## Embeds

- `ExpressionValue`
- `Resource`
- `ResourceWithConnectionString`
- `ResourceWithParent`

## Properties

- `ConnectionStringExpression`: `*ReferenceExpression` `get` -- Gets the connection string expression for the MySQL database.
- `DatabaseName`: `string` `get` -- Gets the database name.
- `JdbcConnectionString`: `*ReferenceExpression` `get` -- Gets the JDBC connection string for the MySQL database.
- `Parent`: [`MySqlServerResource`](/reference/api/go/aspire.hosting.mysql/mysqlserverresource.md) `get` -- Gets the parent MySQL container resource.
- `ResourceTypeDisplayName`: `string` `get` -- Gets the ResourceTypeDisplayName property
- `UriExpression`: `*ReferenceExpression` `get` -- Gets the connection URI expression for the MySQL database.

## Methods

- [WithCreationScript](/reference/api/go/aspire.hosting.mysql/mysqldatabaseresource/withcreationscript.md) -- `method` -- Defines the SQL script used to create the database.
  ```go
  WithCreationScript(script string) MySqlDatabaseResource
  ```
