![]() |
VOOZH | about |
dotnet add package MySql.Data --version 9.7.0
NuGet\Install-Package MySql.Data -Version 9.7.0
<PackageReference Include="MySql.Data" Version="9.7.0" />
<PackageVersion Include="MySql.Data" Version="9.7.0" />Directory.Packages.props
<PackageReference Include="MySql.Data" />Project file
paket add MySql.Data --version 9.7.0
#r "nuget: MySql.Data, 9.7.0"
#:package MySql.Data@9.7.0
#addin nuget:?package=MySql.Data&version=9.7.0Install as a Cake Addin
#tool nuget:?package=MySql.Data&version=9.7.0Install as a Cake Tool
MySQL provides connectivity for client applications developed in .NET compatible programming languages with MySQL Connector/NET through a series of packages.
MySql.Data is the core package of Connector/NET. It is compatible with .NET Framework 4.6+ and .NET 8.0+ and provides classic MySQL protocol and MySQL X DevAPI capabilities.
More information at MySQL Connector/NET documentation.
MySql.Data.MySqlClient.MySqlConnection myConnection;
string myConnectionString;
//set the correct values for your server, user, password and database name
myConnectionString = "server=127.0.0.1;uid=root;pwd=12345;database=test";
try
{
myConnection = new MySql.Data.MySqlClient.MySqlConnection(myConnectionString);
//open a connection
myConnection.Open();
// create a MySQL command and set the SQL statement with parameters
MySqlCommand myCommand = new MySqlCommand();
myCommand.Connection = myConnection;
myCommand.CommandText = @"SELECT * FROM clients WHERE client_id = @clientId;";
myCommand.Parameters.AddWithValue("@clientId", clientId);
// execute the command and read the results
using var myReader = myCommand.ExecuteReader()
{
while (myReader.Read())
{
var id = myReader.GetInt32("client_id");
var name = myReader.GetString("client_name");
// ...
}
}
myConnection.Close();
}
catch (MySql.Data.MySqlClient.MySqlException ex)
{
MessageBox.Show(ex.Message);
}
Please refer to files README and LICENSE, available in the Connector/NET GitHub repository, and Legal Notices in documentation for further details.
Oracle values the independent security research community and believes that responsible disclosure of security vulnerabilities helps us ensure the security and privacy of all our users. Please refer to the security guidelines document for additional information.
We greatly appreciate feedback from our users, including bug reports and code contributions. Your input helps us improve, and we thank you for any issues you report or code you contribute. Please refer to the contributing guidelines document for additional information.
#connectors channel on MySQL Community Slack (Sign-up required if you do not have an Oracle account.)For more information about this and other MySQL products, please visit MySQL Contact & Questions.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 is compatible. |
| .NET Framework | net461 net461 was computed. net462 net462 is compatible. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 is compatible. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 5 NuGet packages that depend on MySql.Data:
| Package | Downloads |
|---|---|
|
MySql.EntityFrameworkCore
MySql.EntityFrameworkCore adds support for Microsoft Entity Framework Core. |
|
|
MySql.Data.EntityFrameworkCore
MySql.Data.EntityFrameworkCore for Entity Framework. |
|
|
MySql.Data.EntityFramework
MySql.Data.EntityFramework |
|
|
OpenTelemetry.Instrumentation.MySqlData
OpenTelemetry instrumentation for MySql.Data |
|
|
JoreNoe
优化一写函数 |
Showing the top 20 popular GitHub repositories that depend on MySql.Data:
| Repository | Stars |
|---|---|
|
mRemoteNG/mRemoteNG
mRemoteNG is the next generation of mRemote, open source, tabbed, multi-protocol, remote connections manager.
|
|
|
dotnet/orleans
Cloud Native application framework for .NET
|
|
|
1Remote/1Remote
One Remote Access Manager to Rule Them All
|
|
|
DotNetNext/SqlSugar
.Net aot ORM SqlServer ORM Mongodb ORM MySql 瀚高 Postgresql ORM DB2 Hana 高斯 Duckdb C# VB.NET Sqlite ORM Oracle ORM Mysql Orm 虚谷数据库 达梦 ORM 人大金仓 ORM 神通ORM C# ORM , C# ORM .NET ORM NET9 ORM .NET8 ORM ClickHouse ORM QuestDb ,TDengine ORM,OceanBase ORM,GaussDB ORM,Tidb ORM Object/Relational Mapping
|
|
|
ServiceStack/ServiceStack
Thoughtfully architected, obscenely fast, thoroughly enjoyable web services for all
|
|
|
dotnetcore/FreeSql
.NET aot orm, VB.NET/C# orm, Mysql/PostgreSQL/SqlServer/Oracle orm, Sqlite/Firebird/Clickhouse/DuckDB orm, 达梦/金仓/虚谷/翰高/高斯 orm, 神通 orm, 南大通用 orm, 国产 orm, TDengine orm, QuestDB orm, MsAccess orm.
|
|
|
fluentmigrator/fluentmigrator
Fluent migrations framework for .NET
|
|
|
sqlkata/querybuilder
SQL query builder, written in c#, helps you build complex queries easily, supports SqlServer, MySql, PostgreSql, Oracle, Sqlite and Firebird
|
|
|
linq2db/linq2db
Linq to database provider.
|
|
|
ONLYOFFICE/CommunityServer
Free open source office suite with business productivity tools: document and project management, CRM, mail aggregator.
|
|
|
SciSharp/BotSharp
AI Multi-Agent Framework in .NET
|
|
|
jbogard/Respawn
Intelligent database cleaner for integration tests
|
|
|
GavinYellow/SharpSCADA
C# SCADA
|
|
|
Pryaxis/TShock
☕️⚡️TShock provides Terraria servers with server-side characters, anti-cheat, and community management tools.
|
|
|
hitchao/Jvedio
Jvedio 是本地视频管理软件,支持扫描本地视频并导入软件,建立视频库, 提取出视频的 唯一识别码,自动分类视频, 添加标签管理视频,使用人工智能识别演员,支持翻译信息, 基于 FFmpeg 截取视频图片,Window 桌面端流畅美观的应用软件
|
|
|
ArgoZhang/BootstrapAdmin
BootstrapAdmin - Free Premium Admin control Panel Based On Bootstrap 4.x
|
|
|
OrchardCMS/Orchard
Orchard is a free, open source, community-focused Content Management System built on the ASP.NET MVC platform. Check out the next generation of this software built on ASP.NET Core: https://github.com/OrchardCMS/OrchardCore
|
|
|
oqtane/oqtane.framework
Oqtane is an open-source developer productivity platform for building modern .NET applications and websites that run on Web, Desktop and Mobile.
|
|
|
nhibernate/nhibernate-core
NHibernate Object Relational Mapper
|
|
|
CollaboratingPlatypus/PetaPoco
Official PetaPoco, A tiny ORM-ish thing for your POCO's
|
| Version | Downloads | Last Updated |
|---|---|---|
| 9.7.0 | 363,417 | 4/22/2026 |
| 9.6.0 | 1,043,310 | 1/21/2026 |
| 9.5.0 | 1,123,516 | 10/22/2025 |
| 9.4.0 | 1,467,676 | 7/22/2025 |
| 9.3.0 | 2,157,133 | 4/15/2025 |
| 9.2.0 | 2,469,974 | 1/21/2025 |
| 9.1.0 | 4,286,400 | 10/15/2024 |
| 9.0.0 | 4,013,406 | 7/1/2024 |
| 8.4.0 | 3,423,956 | 4/30/2024 |
| 8.3.0 | 3,606,529 | 1/16/2024 |
| 8.2.0 | 2,172,477 | 10/25/2023 |
| 8.1.0 | 3,058,502 | 7/18/2023 |
| 8.0.33 | 4,009,640 | 4/18/2023 |
| 8.0.32.1 | 1,830,989 | 3/8/2023 |
| 8.0.32 | 4,394,878 | 1/17/2023 |
| 8.0.31 | 5,274,305 | 10/11/2022 |
| 8.0.30 | 6,260,405 | 7/26/2022 |
| 8.0.29 | 5,449,719 | 4/26/2022 |
| 8.0.28 | 4,545,581 | 1/21/2022 |
| 8.0.27 | 3,004,499 | 10/19/2021 |
Review ReleaseNotes.txt for details.