# 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/bcfa151cdca6d0a573f22d5d9c23f9c727cb3b2f)

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)
