# MySqlServerResource Properties

- Package: [Aspire.Hosting.MySql](/reference/api/csharp/aspire.hosting.mysql.md)
- Type: [MySqlServerResource](/reference/api/csharp/aspire.hosting.mysql/mysqlserverresource.md)
- Kind: `Properties`
- Members: `8`

A resource that represents a MySQL container.

## ConnectionStringExpression

- Name: `ConnectionStringExpression`
- Modifiers: `get`
- Returns: `ReferenceExpression`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.MySql/MySqlServerResource.cs#L55-L56)

Gets the connection string expression for the MySQL server.

```csharp
public ReferenceExpression ConnectionStringExpression { get; }
```

## Databases

- Name: `Databases`
- Modifiers: `get`
- Returns: `IReadOnlyDictionary<string, string>`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.MySql/MySqlServerResource.cs#L111)

A dictionary where the key is the resource name and the value is the database name.

```csharp
public IReadOnlyDictionary<string, string> Databases { get; }
```

## Host

- Name: `Host`
- Modifiers: `get`
- Returns: `EndpointReferenceExpression`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.MySql/MySqlServerResource.cs#L39)

Gets the host endpoint reference for this resource.

```csharp
public EndpointReferenceExpression Host { get; }
```

## JdbcConnectionString

- Name: `JdbcConnectionString`
- Modifiers: `get`
- Returns: `ReferenceExpression`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.MySql/MySqlServerResource.cs#L106)

Gets the JDBC connection string for the MySQL server.

```csharp
public ReferenceExpression JdbcConnectionString { get; }
```

## Remarks

Format: `jdbc:mysql://{host}:{port}`.

User and password credentials are not included in the JDBC connection string. Use the `Username` and `Password` connection properties to access credentials.

## PasswordParameter

- Name: `PasswordParameter`
- Modifiers: `get; set`
- Returns: `ParameterResource`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.MySql/MySqlServerResource.cs)

Gets or sets the parameter that contains the MySQL server password.

```csharp
public ParameterResource PasswordParameter { get; set; }
```

## Port

- Name: `Port`
- Modifiers: `get`
- Returns: `EndpointReferenceExpression`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.MySql/MySqlServerResource.cs#L44)

Gets the port endpoint reference for this resource.

```csharp
public EndpointReferenceExpression Port { get; }
```

## PrimaryEndpoint

- Name: `PrimaryEndpoint`
- Modifiers: `get`
- Returns: `EndpointReference`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.MySql/MySqlServerResource.cs#L34)

Gets the primary endpoint for the MySQL server.

```csharp
public EndpointReference PrimaryEndpoint { get; }
```

## UriExpression

- Name: `UriExpression`
- Modifiers: `get`
- Returns: `ReferenceExpression`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.MySql/MySqlServerResource.cs#L66)

Gets the connection URI expression for the MySQL server.

```csharp
public ReferenceExpression UriExpression { get; }
```

## Remarks

Format: `mysql://{user}:{password}@{host}:{port}`.
