MySql.Data
9.1.0
Prefix Reserved
dotnet add package MySql.Data --version 9.1.0
NuGet\Install-Package MySql.Data -Version 9.1.0
<PackageReference Include="MySql.Data" Version="9.1.0" />
paket add MySql.Data --version 9.1.0
#r "nuget: MySql.Data, 9.1.0"
// Install MySql.Data as a Cake Addin #addin nuget:?package=MySql.Data&version=9.1.0 // Install MySql.Data as a Cake Tool #tool nuget:?package=MySql.Data&version=9.1.0
About
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 6.0+ and provides classic MySQL protocol and MySQL X DevAPI capabilities.
More information at MySQL Connector/NET documentation.
How to use
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);
}
Related Packages
- Entity Framework Core: MySql.EntityFrameworkCore
- Entity Framework: MySql.Data.EntityFramework
- Web: MySql.Web
- OpenTelemetry: MySql.Data.OpenTelemetry
Licensing
Please refer to files README and LICENSE, available in the Connector/NET GitHub repository, and Legal Notices in documentation for further details.
Security
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.
Contributing
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.
Additional Resources
- MySQL Connector/NET GitHub
- MySQL Connector/NET Developer Guide
- MySQL Connector/NET API
- MySQL NuGet
- MySQL Connector/NET and C#, Mono, .Net Forum
#connectors
channel on MySQL Community Slack (Sign-up required if you do not have an Oracle account.)- @MySQL on X.
- MySQL Blog.
- MySQL Connectors Blog archive.
- MySQL Newsletter.
- MySQL Bugs Tracking System.
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 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
.NET Framework | net461 was computed. net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 is compatible. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.6.2
- BouncyCastle.Cryptography (>= 2.3.1)
- Google.Protobuf (>= 3.26.1)
- K4os.Compression.LZ4.Streams (>= 1.3.8)
- System.Buffers (>= 4.5.1)
- System.Configuration.ConfigurationManager (>= 8.0.0)
- System.Diagnostics.DiagnosticSource (>= 8.0.1)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
- System.Threading.Tasks.Extensions (>= 4.5.4)
- ZstdSharp.Port (>= 0.8.0)
-
.NETFramework 4.8
- BouncyCastle.Cryptography (>= 2.3.1)
- Google.Protobuf (>= 3.26.1)
- K4os.Compression.LZ4.Streams (>= 1.3.8)
- System.Buffers (>= 4.5.1)
- System.Configuration.ConfigurationManager (>= 8.0.0)
- System.Diagnostics.DiagnosticSource (>= 8.0.1)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
- System.Threading.Tasks.Extensions (>= 4.5.4)
- ZstdSharp.Port (>= 0.8.0)
-
.NETStandard 2.0
- BouncyCastle.Cryptography (>= 2.3.1)
- Google.Protobuf (>= 3.26.1)
- K4os.Compression.LZ4.Streams (>= 1.3.8)
- System.Buffers (>= 4.5.1)
- System.Configuration.ConfigurationManager (>= 8.0.0)
- System.Diagnostics.DiagnosticSource (>= 8.0.1)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
- System.Runtime.Loader (>= 4.3.0)
- System.Security.Permissions (>= 8.0.0)
- System.Text.Encoding.CodePages (>= 8.0.0)
- System.Text.Json (>= 8.0.4)
- System.Threading.Tasks.Extensions (>= 4.5.4)
- ZstdSharp.Port (>= 0.8.0)
-
.NETStandard 2.1
- BouncyCastle.Cryptography (>= 2.3.1)
- Google.Protobuf (>= 3.26.1)
- K4os.Compression.LZ4.Streams (>= 1.3.8)
- System.Buffers (>= 4.5.1)
- System.Configuration.ConfigurationManager (>= 8.0.0)
- System.Diagnostics.DiagnosticSource (>= 8.0.1)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
- System.Runtime.Loader (>= 4.3.0)
- System.Security.Permissions (>= 8.0.0)
- System.Text.Encoding.CodePages (>= 8.0.0)
- System.Text.Json (>= 8.0.4)
- System.Threading.Tasks.Extensions (>= 4.5.4)
- ZstdSharp.Port (>= 0.8.0)
-
net6.0
- BouncyCastle.Cryptography (>= 2.3.1)
- Google.Protobuf (>= 3.26.1)
- K4os.Compression.LZ4.Streams (>= 1.3.8)
- System.Buffers (>= 4.5.1)
- System.Configuration.ConfigurationManager (>= 8.0.0)
- System.Diagnostics.DiagnosticSource (>= 8.0.1)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
- System.Runtime.Loader (>= 4.3.0)
- System.Security.Permissions (>= 8.0.0)
- System.Text.Encoding.CodePages (>= 8.0.0)
- System.Text.Json (>= 8.0.4)
- System.Threading.Tasks.Extensions (>= 4.5.4)
- ZstdSharp.Port (>= 0.8.0)
-
net8.0
- BouncyCastle.Cryptography (>= 2.3.1)
- Google.Protobuf (>= 3.26.1)
- K4os.Compression.LZ4.Streams (>= 1.3.8)
- System.Buffers (>= 4.5.1)
- System.Configuration.ConfigurationManager (>= 8.0.0)
- System.Diagnostics.DiagnosticSource (>= 8.0.1)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
- System.Runtime.Loader (>= 4.3.0)
- System.Security.Permissions (>= 8.0.0)
- System.Text.Encoding.CodePages (>= 8.0.0)
- System.Text.Json (>= 8.0.4)
- System.Threading.Tasks.Extensions (>= 4.5.4)
- ZstdSharp.Port (>= 0.8.0)
NuGet packages (1.8K)
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 |
|
linq2db.MySql
LINQ to MySql is a data access technology that provides a run-time infrastructure for managing relational data as objects. Install this package only if you want to use database model scaffolding using T4 templates (requires Visual Studio or Rider), otherwise you should use linq2db package. |
|
MySqlBackup.NET
A tool to backup and restore MySQL database in C#/VB.NET/ASP.NET. |
GitHub repositories (167)
Showing the top 5 popular GitHub repositories that depend on MySql.Data:
Repository | Stars |
---|---|
dotnet/orleans
Cloud Native application framework for .NET
|
|
mRemoteNG/mRemoteNG
mRemoteNG is the next generation of mRemote, open source, tabbed, multi-protocol, remote connections manager.
|
|
ServiceStack/ServiceStack
Thoughtfully architected, obscenely fast, thoroughly enjoyable web services for all
|
|
DotNetNext/SqlSugar
.Net aot ORM Fastest ORM Simple Easy VB.NET Sqlite orm Oracle ORM Mysql Orm 虚谷数据库 postgresql ORm SqlServer oRm 达梦 ORM 人大金仓 ORM 神通ORM C# ORM , C# ORM .NET ORM NET5 ORM .NET6 ORM ClickHouse orm QuestDb ,TDengine ORM,OceanBase orm,GaussDB orm ,Tidb orm Object/Relational Mapping
|
|
1Remote/1Remote
One Remote Access Manager to Rule Them All
|
Version | Downloads | Last updated |
---|---|---|
9.1.0 | 228,912 | 10/15/2024 |
9.0.0 | 957,034 | 7/1/2024 |
8.4.0 | 979,672 | 4/30/2024 |
8.3.0 | 1,724,323 | 1/16/2024 |
8.2.0 | 1,227,188 | 10/25/2023 |
8.1.0 | 1,662,854 | 7/18/2023 |
8.0.33 | 2,192,877 | 4/18/2023 |
8.0.32.1 | 1,160,410 | 3/8/2023 |
8.0.32 | 2,237,225 | 1/17/2023 |
8.0.31 | 3,464,344 | 10/11/2022 |
8.0.30 | 4,271,126 | 7/26/2022 |
8.0.29 | 4,371,905 | 4/26/2022 |
8.0.28 | 3,073,249 | 1/21/2022 |
8.0.27 | 2,608,005 | 10/19/2021 |
8.0.26 | 2,434,575 | 7/20/2021 |
8.0.25 | 2,228,762 | 5/11/2021 |
8.0.24 | 1,197,266 | 4/20/2021 |
8.0.23 | 2,551,277 | 1/18/2021 |
8.0.22 | 3,758,344 | 10/19/2020 |
8.0.21 | 4,919,044 | 7/13/2020 |
8.0.20 | 3,176,299 | 4/27/2020 |
8.0.19 | 3,340,081 | 1/13/2020 |
8.0.18 | 2,947,176 | 10/14/2019 |
8.0.17 | 2,763,295 | 7/22/2019 |
8.0.16 | 2,898,742 | 4/26/2019 |
8.0.15 | 3,114,770 | 2/1/2019 |
8.0.14 | 872,876 | 1/22/2019 |
8.0.13 | 2,253,114 | 10/22/2018 |
8.0.12 | 2,720,876 | 7/27/2018 |
8.0.11 | 2,045,898 | 4/19/2018 |
6.10.9 | 3,243,369 | 7/29/2019 |
6.10.7 | 1,845,807 | 4/30/2018 |
6.9.12 | 2,829,155 | 5/4/2018 |
6.8.8 | 391,770 | 6/27/2016 |
6.7.9 | 795,495 | 10/14/2015 |
Review ReleaseNotes.txt for details.