MySql.Data 8.3.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
Contributing
There are a few ways to contribute to the Connector/NET code. Please refer to the contributing guidelines for additional information.
Additional Resources
- MySQL
- MySQL Connector/NET GitHub
- MySQL Connector/NET API
- MySQL Connector/NET Discussion Forum
- MySQL Public Bug Tracker
#connectorschannel in MySQL Community Slack (Sign-up required when not using an Oracle account)- For more information about this and other MySQL products, please visit MySQL Contact & Questions.
Showing the top 20 packages that depend on MySql.Data.
| Packages | Downloads |
|---|---|
|
Hangfire.MySql.Core
Hangfire的Mysql存储组件,支持.net core 1.1, .net core 2.0 ,.net standard 2.0。基于Hangfire.MySqlStorage,修复了一些bug,提供了.net standard 2.0支持。
|
1 |
|
Hangfire.MySqlStorage
Hangfire MySql Storage
|
1 |
|
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.
|
1 |
|
linq2db.MySql
LINQ to MySql is a data access technology that provides a run-time infrastructure for managing relational data as objects.
This package includes a T4 template to generate data models for MySql database and references to the linq2db and MySql.Data nugets.
|
1 |
|
MySql.Data.EntityFramework
MySql.Data.EntityFramework
|
1 |
|
MySql.Data.EntityFramework
MySql.Data.EntityFramework
|
5 |
|
MySql.EntityFrameworkCore
MySQL Server database provider for Entity Framework Core.
|
1 |
|
MySql.EntityFrameworkCore
MySql.EntityFrameworkCore adds support for Microsoft Entity Framework Core.
|
2 |
|
MySql.EntityFrameworkCore
MySql.EntityFrameworkCore for Entity Framework.
|
2 |
|
MySql.EntityFrameworkCore
MySql.EntityFrameworkCore for Entity Framework.
|
3 |
|
MySql.EntityFrameworkCore
MySql.EntityFrameworkCore for Entity Framework.
|
29 |
|
SqlSugarCore
.Net Core .Net5 .Net6 .Net7 安装此版本, 版本说明: 5.0.3.5-Max 最低要求.Net Core 3.0+ ,5.0.0-5.0.3.4 最低要求 .Net Core 2.0+ SqlSugar ORM ,High-performance, lightweight
|
1 |
|
SqlSugarCore
.Net Core .Net5 .Net6 .Net7 安装此版本, 版本说明: 5.0.3.5-Max 最低要求.Net Core 3.0+ ,5.0.0-5.0.3.4 最低要求 .Net Core 2.0+ SqlSugar ORM ,High-performance, lightweight
|
3 |
|
sqlSugarCore
.Net Core 2.0 SqlSugar ORM ,High-performance, lightweight https://github.com/sunkaixuan/SqlSugar
|
5 |
Review ReleaseNotes.txt for details.
.NET Framework 4.6.2
- BouncyCastle.Cryptography (>= 2.2.1)
- ZstdSharp.Port (>= 0.7.1)
- System.Threading.Tasks.Extensions (>= 4.5.4)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
- System.Diagnostics.DiagnosticSource (>= 7.0.2)
- System.Configuration.ConfigurationManager (>= 4.4.1)
- System.Buffers (>= 4.5.1)
- K4os.Compression.LZ4.Streams (>= 1.3.5)
- Google.Protobuf (>= 3.25.1)
.NET Standard 2.0
- System.Configuration.ConfigurationManager (>= 4.4.1)
- System.Buffers (>= 4.5.1)
- K4os.Compression.LZ4.Streams (>= 1.3.5)
- Google.Protobuf (>= 3.25.1)
- BouncyCastle.Cryptography (>= 2.2.1)
- System.Diagnostics.DiagnosticSource (>= 7.0.2)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
- System.Security.Permissions (>= 4.7.0)
- ZstdSharp.Port (>= 0.7.1)
- System.Threading.Tasks.Extensions (>= 4.5.4)
- System.Text.Json (>= 7.0.1)
- System.Text.Encoding.CodePages (>= 4.4.0)
- System.Runtime.Loader (>= 4.3.0)
.NET 8.0
- ZstdSharp.Port (>= 0.7.1)
- System.Threading.Tasks.Extensions (>= 4.5.4)
- System.Text.Json (>= 7.0.1)
- System.Text.Encoding.CodePages (>= 4.4.0)
- System.Security.Permissions (>= 4.7.0)
- System.Runtime.Loader (>= 4.3.0)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
- System.Diagnostics.DiagnosticSource (>= 7.0.2)
- System.Configuration.ConfigurationManager (>= 4.4.1)
- System.Buffers (>= 4.5.1)
- K4os.Compression.LZ4.Streams (>= 1.3.5)
- BouncyCastle.Cryptography (>= 2.2.1)
- Google.Protobuf (>= 3.25.1)
.NET 7.0
- ZstdSharp.Port (>= 0.7.1)
- System.Threading.Tasks.Extensions (>= 4.5.4)
- System.Text.Encoding.CodePages (>= 4.4.0)
- System.Text.Json (>= 7.0.1)
- System.Security.Permissions (>= 4.7.0)
- System.Runtime.Loader (>= 4.3.0)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
- System.Diagnostics.DiagnosticSource (>= 7.0.2)
- System.Buffers (>= 4.5.1)
- K4os.Compression.LZ4.Streams (>= 1.3.5)
- Google.Protobuf (>= 3.25.1)
- System.Configuration.ConfigurationManager (>= 4.4.1)
- BouncyCastle.Cryptography (>= 2.2.1)
.NET Standard 2.1
- ZstdSharp.Port (>= 0.7.1)
- System.Threading.Tasks.Extensions (>= 4.5.4)
- System.Text.Json (>= 7.0.1)
- System.Text.Encoding.CodePages (>= 4.4.0)
- System.Security.Permissions (>= 4.7.0)
- System.Runtime.Loader (>= 4.3.0)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
- System.Diagnostics.DiagnosticSource (>= 7.0.2)
- System.Configuration.ConfigurationManager (>= 4.4.1)
- System.Buffers (>= 4.5.1)
- K4os.Compression.LZ4.Streams (>= 1.3.5)
- Google.Protobuf (>= 3.25.1)
- BouncyCastle.Cryptography (>= 2.2.1)
.NET 6.0
- BouncyCastle.Cryptography (>= 2.2.1)
- Google.Protobuf (>= 3.25.1)
- K4os.Compression.LZ4.Streams (>= 1.3.5)
- System.Configuration.ConfigurationManager (>= 4.4.1)
- System.Buffers (>= 4.5.1)
- ZstdSharp.Port (>= 0.7.1)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
- System.Runtime.Loader (>= 4.3.0)
- System.Diagnostics.DiagnosticSource (>= 7.0.2)
- System.Text.Encoding.CodePages (>= 4.4.0)
- System.Text.Json (>= 7.0.1)
- System.Threading.Tasks.Extensions (>= 4.5.4)
- System.Security.Permissions (>= 4.7.0)
.NET Framework 4.8
- System.Threading.Tasks.Extensions (>= 4.5.4)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
- System.Diagnostics.DiagnosticSource (>= 7.0.2)
- System.Configuration.ConfigurationManager (>= 4.4.1)
- System.Buffers (>= 4.5.1)
- K4os.Compression.LZ4.Streams (>= 1.3.5)
- Google.Protobuf (>= 3.25.1)
- BouncyCastle.Cryptography (>= 2.2.1)
- ZstdSharp.Port (>= 0.7.1)
| Version | Downloads | Last updated |
|---|---|---|
| 9.6.0 | 3 | 2026/4/8 |
| 9.5.0 | 1 | 2026/4/8 |
| 9.4.0 | 1 | 2026/4/8 |
| 9.3.0 | 4 | 2025/4/28 |
| 9.2.0 | 1 | 2026/4/8 |
| 9.1.0 | 1 | 2026/4/8 |
| 9.0.0 | 1 | 2026/4/8 |
| 8.4.0 | 6 | 2024/10/18 |
| 8.3.0 | 1 | 2026/4/8 |
| 8.2.0 | 1 | 2026/4/8 |
| 8.1.0 | 1 | 2026/4/8 |
| 8.0.33 | 0 | 2023/4/18 |
| 8.0.32.1 | 0 | 2023/3/8 |
| 8.0.32 | 1 | 2026/4/11 |
| 8.0.31 | 1 | 2026/4/11 |
| 8.0.30 | 0 | 2022/7/26 |
| 8.0.29 | 23 | 2024/12/4 |
| 8.0.28 | 0 | 2022/1/21 |
| 8.0.27 | 1 | 2026/4/11 |
| 8.0.26 | 1 | 2026/4/11 |
| 8.0.25 | 1 | 2026/4/11 |
| 8.0.24 | 4 | 2024/9/11 |
| 8.0.23 | 2 | 2025/7/7 |
| 8.0.22 | 1 | 2026/4/11 |
| 8.0.21 | 1 | 2026/4/11 |
| 8.0.20 | 1 | 2026/4/11 |
| 8.0.19 | 1 | 2026/4/11 |
| 8.0.18 | 0 | 2019/10/14 |
| 8.0.17 | 1 | 2026/4/11 |
| 8.0.16 | 1 | 2026/4/11 |
| 8.0.15 | 5 | 2025/3/3 |
| 8.0.14 | 1 | 2026/4/11 |
| 8.0.13 | 2 | 2024/12/9 |
| 8.0.12 | 1 | 2026/4/11 |
| 8.0.11 | 1 | 2025/4/28 |
| 7.0.7-m61 | 1 | 2025/2/14 |
| 6.10.9 | 2 | 2025/4/28 |
| 6.10.7 | 1 | 2026/4/11 |
| 6.9.12 | 7 | 2024/12/14 |
| 6.9.9 | 2 | 2025/2/14 |
| 6.8.8 | 11 | 2024/12/3 |
| 6.7.9 | 2 | 2025/5/13 |