Aspire.Hosting.MySql
13.5.3
Prefix Reserved
dotnet add package Aspire.Hosting.MySql --version 13.5.3
NuGet\Install-Package Aspire.Hosting.MySql -Version 13.5.3
<PackageReference Include="Aspire.Hosting.MySql" Version="13.5.3" />
<PackageVersion Include="Aspire.Hosting.MySql" Version="13.5.3" />
<PackageReference Include="Aspire.Hosting.MySql" />
paket add Aspire.Hosting.MySql --version 13.5.3
#r "nuget: Aspire.Hosting.MySql, 13.5.3"
#:package Aspire.Hosting.MySql@13.5.3
#addin nuget:?package=Aspire.Hosting.MySql&version=13.5.3
#tool nuget:?package=Aspire.Hosting.MySql&version=13.5.3
MySQL hosting integration
Use this integration to model, configure, and orchestrate a MySQL resource in an Aspire solution.
Getting started
Add the integration
From your AppHost directory, add the Aspire.Hosting.MySql integration with the Aspire CLI:
aspire add Aspire.Hosting.MySql
Usage example
In the AppHost, add a MySQL resource and reference it from another resource with either C# or TypeScript:
C#
var db = builder.AddMySql("mysql").AddDatabase("mydb");
var myService = builder.AddProject<Projects.MyService>()
.WithReference(db);
TypeScript
const db = await builder.addMySql("mysql").addDatabase("mydb");
const myService = await builder.addNodeApp("myService", "../my-service", "server.js")
.withReference(db);
Connection Properties
When you reference a MySQL resource using WithReference, the following connection properties are made available to the consuming project:
MySQL server
The MySQL server resource exposes the following connection properties:
| Property Name | Description |
|---|---|
Host |
The hostname or IP address of the MySQL server |
Port |
The port number the MySQL server is listening on |
Username |
The username for authentication |
Password |
The password for authentication |
Uri |
The connection URI, with the format mysql://root:{Password}@{Host}:{Port} |
JdbcConnectionString |
The JDBC connection string for MySQL, with the format jdbc:mysql://{Host}:{Port}. User and password credentials are provided as separate Username and Password properties. |
MySQL database
The MySQL database resource combines the server properties above and adds the following connection properties:
| Property Name | Description |
|---|---|
DatabaseName |
The MySQL database name |
Uri |
The database-specific URI, with the format mysql://root:{Password}@{Host}:{Port}/{DatabaseName} |
JdbcConnectionString |
The database-specific JDBC connection string, with the format jdbc:mysql://{Host}:{Port}/{DatabaseName}. User and password credentials are provided as separate Username and Password properties. |
Aspire exposes each property as an environment variable named [RESOURCE]_[PROPERTY]. For instance, the Uri property of a resource called db1 becomes DB1_URI.
Additional documentation
- https://aspire.dev/integrations/gallery/
- https://aspire.dev/integrations/databases/mysql/mysql-host/
Feedback & contributing
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Aspire.Hosting (>= 13.5.3)
- AspNetCore.HealthChecks.MySql (>= 9.0.0)
- AspNetCore.HealthChecks.Uris (>= 9.0.0)
- Google.Protobuf (>= 3.34.1)
- Grpc.AspNetCore (>= 2.80.0)
- Grpc.Net.ClientFactory (>= 2.80.0)
- Grpc.Tools (>= 2.80.0)
- Humanizer.Core (>= 3.0.10)
- JsonPatch.Net (>= 5.0.2)
- KubernetesClient (>= 19.0.2)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.11)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.11)
- Microsoft.Extensions.Configuration.EnvironmentVariables (>= 10.0.11)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.11)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 8.0.30)
- Microsoft.Extensions.FileSystemGlobbing (>= 10.0.11)
- Microsoft.Extensions.Hosting (>= 10.0.11)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.11)
- Microsoft.Extensions.Http (>= 10.0.11)
- Microsoft.Extensions.Logging (>= 10.0.11)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.11)
- Microsoft.Extensions.Options (>= 10.0.11)
- Microsoft.Extensions.Primitives (>= 10.0.11)
- ModelContextProtocol (>= 1.3.0)
- Newtonsoft.Json (>= 13.0.4)
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.15.3)
- OpenTelemetry.Extensions.Hosting (>= 1.15.3)
- Polly.Core (>= 8.6.6)
- Semver (>= 3.0.0)
- StreamJsonRpc (>= 2.25.29)
- System.IO.Hashing (>= 10.0.8)
- System.Text.Json (>= 10.0.11)
- YamlDotNet (>= 16.3.0)
NuGet packages (10)
Showing the top 5 NuGet packages that depend on Aspire.Hosting.MySql:
| Package | Downloads |
|---|---|
|
CommunityToolkit.Aspire.Hosting.MySql.Extensions
An Aspire hosting integration for extending MySQL resources with additional management tooling. |
|
|
Shiny.DocumentDb.Aspire.Hosting
.NET Aspire AppHost integration for Shiny.DocumentDb — model a document store as a resource, pick its backend (Postgres/SQL Server/MySQL/SQLite), and gate seeding. JIT-only (Aspire hosting is reflection-heavy). |
|
|
Shiny.Aspire.Orleans.Hosting
Package Description |
|
|
YMJake.Aspire.Hosting.Apollo
Hosting extensions for running Apollo Configuration Center with .NET Aspire (config service, admin service, portal, MySQL init scripts included). |
|
|
Girvs.Aspire.Hosting
Package Description |
GitHub repositories (8)
Showing the top 8 popular GitHub repositories that depend on Aspire.Hosting.MySql:
| Repository | Stars |
|---|---|
|
bitfoundation/bitplatform
Build all of your apps using what you already know and love ❤️
|
|
|
microsoft/aspire-samples
Browse the sample apps demonstrating Aspire integration across C#, JavaScript, TypeScript, Python, Go, containers, databases, cloud, AI, and observability scenarios.
|
|
|
NexusForever/NexusForever
An emulator for the defunct MMORPG WildStar which supports build 16042 (Final Patch)
|
|
|
CommunityToolkit/Aspire
A community project with additional components and extensions for Aspire
|
|
|
AAEmu/AAEmu
A server software for ArcheAge written in .Net C#
|
|
|
formcms/formcms
AI Agent: Open-source headless CMS built with ASP.NET Core (C#) and React, featuring REST APIs, GraphQL, and a GrapesJS page designer.
|
|
|
amasen02/freshcart-backend
FreshCart — .NET 10 + Aspire microservices reference e-commerce platform with an Angular 20 SPA
|
|
|
PacktPublishing/Pragmatic-Microservices-with-CSharp-and-Azure
Pragmatic Microservices with C# and Azure, published by Packt
|
| Version | Downloads | Last Updated |
|---|---|---|
| 13.5.3 | 6,223 | 2026/8/25 |
| 13.5.2 | 2,798 | 2026/8/21 |
| 13.5.1 | 759 | 2026/8/20 |
| 13.5.0 | 2,101 | 2026/8/18 |
| 13.4.6 | 33,451 | 2026/6/19 |
| 13.4.5 | 5,223 | 2026/6/17 |
| 13.4.4 | 1,665 | 2026/6/15 |
| 13.4.3 | 7,072 | 2026/6/8 |
| 13.4.2 | 8,226 | 2026/6/3 |
| 13.4.1 | 311 | 2026/6/3 |
| 13.4.0 | 3,153 | 2026/6/1 |
| 13.3.5 | 16,640 | 2026/5/21 |
| 13.3.4 | 843 | 2026/5/19 |
| 13.3.3 | 6,150 | 2026/5/15 |
| 13.3.2 | 1,266 | 2026/5/14 |
| 13.3.1 | 1,865 | 2026/5/12 |
| 13.3.0 | 6,950 | 2026/5/7 |
| 13.2.4 | 5,798 | 2026/4/24 |
| 13.2.3 | 2,504 | 2026/4/21 |
| 13.2.2 | 11,099 | 2026/4/8 |