# WithCreationScript

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

Defines the SQL script used to create the database.

## Remarks

Default script is
```
CREATE DATABASE IF NOT EXISTS `QUOTED_DATABASE_NAME`;
```

## Definition

```go
func (MySqlDatabaseResource) WithCreationScript(script string) MySqlDatabaseResource
```

## Parameters

- `script` (`string`) -- The SQL script used to create the database.

## Returns

[`MySqlDatabaseResource`](/reference/api/go/aspire.hosting.mysql/mysqldatabaseresource.md) -- The resource builder.

Returns a handle; failures surface later via `Err()`.

## Applies to

- [`MySqlDatabaseResource`](/reference/api/go/aspire.hosting.mysql/mysqldatabaseresource.md)
