# MySqlServerResource

- 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 MySqlServerResource
  extends IComputeResource,
    IManifestExpressionProvider,
    IResource,
    IResourceWithArgs,
    IResourceWithConnectionString,
    IResourceWithEndpoints,
    IResourceWithEnvironment,
    IResourceWithProbes,
    IResourceWithWaitSupport,
    IValueProvider,
    IValueWithReferences {
  readonly connectionStringExpression: ReferenceExpression;
  readonly databases: Dict<string,string>;
  entrypoint: string;
  readonly host: EndpointReferenceExpression;
  readonly jdbcConnectionString: ReferenceExpression;
  readonly name: string;
  passwordParameter: ParameterResource;
  readonly port: EndpointReferenceExpression;
  readonly primaryEndpoint: EndpointReference;
  shellExecution: boolean;
  readonly uriExpression: ReferenceExpression;
  addDatabase(
      name: string,
      databaseName?: string): MySqlDatabaseResource;
  withDataBindMount(
      source: string,
      isReadOnly?: boolean): MySqlServerResource;
  withDataVolume(
      name?: string,
      isReadOnly?: boolean): MySqlServerResource;
  withInitFiles(source: string): MySqlServerResource;
  withPassword(password: ParameterResource): MySqlServerResource;
  withPhpMyAdmin(configureContainer?: (obj: PhpMyAdminContainerResource) => Promise<void>, containerName?: string): MySqlServerResource;
}
```

## Properties

- `connectionStringExpression`: `ReferenceExpression` `get` -- Gets the ConnectionStringExpression property
- `databases`: `Dict<string,string>` `get` -- Gets the Databases property
- `entrypoint`: `string` `get - set` -- Gets the Entrypoint property
- `host`: `EndpointReferenceExpression` `get` -- Gets the Host property
- `jdbcConnectionString`: `ReferenceExpression` `get` -- Gets the JdbcConnectionString property
- `name`: `string` `get` -- Gets the Name property
- `passwordParameter`: `ParameterResource` `get - set` -- Gets the PasswordParameter property
- `port`: `EndpointReferenceExpression` `get` -- Gets the Port property
- `primaryEndpoint`: `EndpointReference` `get` -- Gets the PrimaryEndpoint property
- `shellExecution`: `boolean` `get - set` -- Gets the ShellExecution property
- `uriExpression`: `ReferenceExpression` `get` -- Gets the UriExpression property

## Methods

- [addDatabase](/reference/api/typescript/aspire.hosting.mysql/mysqlserverresource/adddatabase.md) -- `method` -- Adds a MySQL database
    ```typescript
  addDatabase(name: string, databaseName?: string): MySqlDatabaseResource
  ```
- [withDataBindMount](/reference/api/typescript/aspire.hosting.mysql/mysqlserverresource/withdatabindmount.md) -- `method` -- Adds a data bind mount for MySQL
    ```typescript
  withDataBindMount(source: string, isReadOnly?: boolean): MySqlServerResource
  ```
- [withDataVolume](/reference/api/typescript/aspire.hosting.mysql/mysqlserverresource/withdatavolume.md) -- `method` -- Adds a data volume for MySQL
    ```typescript
  withDataVolume(name?: string, isReadOnly?: boolean): MySqlServerResource
  ```
- [withInitFiles](/reference/api/typescript/aspire.hosting.mysql/mysqlserverresource/withinitfiles.md) -- `method` -- Copies init files to MySQL
    ```typescript
  withInitFiles(source: string): MySqlServerResource
  ```
- [withPassword](/reference/api/typescript/aspire.hosting.mysql/mysqlserverresource/withpassword.md) -- `method` -- Configures the MySQL password
    ```typescript
  withPassword(password: ParameterResource): MySqlServerResource
  ```
- [withPhpMyAdmin](/reference/api/typescript/aspire.hosting.mysql/mysqlserverresource/withphpmyadmin.md) -- `method` -- Adds phpMyAdmin management UI
    ```typescript
  withPhpMyAdmin(configureContainer?: (obj: PhpMyAdminContainerResource) => Promise<void>, containerName?: string): MySqlServerResource
  ```
