MySql.Data 9.4.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 8.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.
Showing the top 20 packages that depend on MySql.Data.
Packages | Downloads |
---|---|
WEF.Standard.MySQL
WEF is based on the c # data entity framework supports MSQSqlServer, MySql, Orcalce, etc of conventional database and fast development, which integrates a large amount of data set under the development experience of tools, such as the Lambada without SQL query expression, add and delete, entity cloning, bulk and the parameters of the table, transaction, round of entities or stored procedures, SQL entities, etc.
WEF 是基于C#的数据实体框架,支持MSQSqlServer、MySql、Orcalce等等常规的数据库的快捷开发,其中集成了大量数据开发经验下的工具类集合,比如Lambada表达式查询、无sql的增删改查、实体克隆、批量、多表、事务、参数、SQL转实体或存储过程转实体等。
|
9 |
WEF.Standard.MySQL
WEF is based on the c # data entity framework supports MSQSqlServer, MySql, Orcalce, etc of conventional database and fast development, which integrates a large amount of data set under the development experience of tools, such as the Lambada without SQL query expression, add and delete, entity cloning, bulk and the parameters of the table, transaction, round of entities or stored procedures, SQL entities, etc.
WEF 是基于C#的数据实体框架,支持MSQSqlServer、MySql、Orcalce等等常规的数据库的快捷开发,其中集成了大量数据开发经验下的工具类集合,比如Lambada表达式查询、无sql的增删改查、实体克隆、批量、多表、事务、参数、SQL转实体或存储过程转实体等。
|
8 |
WEF.Standard.MySQL
WEF is based on the c # data entity framework supports MSQSqlServer, MySql, Orcalce, etc of conventional database and fast development, which integrates a large amount of data set under the development experience of tools, such as the Lambada without SQL query expression, add and delete, entity cloning, bulk and the parameters of the table, transaction, round of entities or stored procedures, SQL entities, etc.
WEF 是基于C#的数据实体框架,支持MSQSqlServer、MySql、Orcalce等等常规的数据库的快捷开发,其中集成了大量数据开发经验下的工具类集合,比如Lambada表达式查询、无sql的增删改查、实体克隆、批量、多表、事务、参数、SQL转实体或存储过程转实体等。
|
7 |
.NET Framework 4.6.2
- BouncyCastle.Cryptography (>= 2.5.1)
- ZstdSharp.Port (>= 0.8.5)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
- System.Diagnostics.DiagnosticSource (>= 8.0.1)
- System.Configuration.ConfigurationManager (>= 8.0.0)
- System.Buffers (>= 4.5.1)
- K4os.Compression.LZ4.Streams (>= 1.3.8)
- Google.Protobuf (>= 3.30.0)
- System.Threading.Tasks.Extensions (>= 4.5.4)
.NET Standard 2.0
- System.Runtime.Loader (>= 4.3.0)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
- System.Diagnostics.DiagnosticSource (>= 8.0.1)
- System.Configuration.ConfigurationManager (>= 8.0.0)
- System.Buffers (>= 4.5.1)
- K4os.Compression.LZ4.Streams (>= 1.3.8)
- System.Security.Permissions (>= 8.0.0)
- Google.Protobuf (>= 3.30.0)
- BouncyCastle.Cryptography (>= 2.5.1)
- System.Text.Encoding.CodePages (>= 8.0.0)
- System.Threading.Tasks.Extensions (>= 4.5.4)
- System.Text.Json (>= 9.0.0)
- ZstdSharp.Port (>= 0.8.5)
.NET 9.0
- ZstdSharp.Port (>= 0.8.5)
- System.Threading.Tasks.Extensions (>= 4.5.4)
- System.Text.Json (>= 9.0.0)
- System.Text.Encoding.CodePages (>= 8.0.0)
- System.Security.Permissions (>= 8.0.0)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
- System.Diagnostics.DiagnosticSource (>= 8.0.1)
- System.Configuration.ConfigurationManager (>= 8.0.0)
- System.Runtime.Loader (>= 4.3.0)
- K4os.Compression.LZ4.Streams (>= 1.3.8)
- System.Buffers (>= 4.5.1)
- Google.Protobuf (>= 3.30.0)
- BouncyCastle.Cryptography (>= 2.5.1)
.NET Standard 2.1
- ZstdSharp.Port (>= 0.8.5)
- System.Threading.Tasks.Extensions (>= 4.5.4)
- System.Text.Json (>= 9.0.0)
- System.Text.Encoding.CodePages (>= 8.0.0)
- System.Security.Permissions (>= 8.0.0)
- System.Runtime.Loader (>= 4.3.0)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
- System.Configuration.ConfigurationManager (>= 8.0.0)
- System.Buffers (>= 4.5.1)
- K4os.Compression.LZ4.Streams (>= 1.3.8)
- Google.Protobuf (>= 3.30.0)
- BouncyCastle.Cryptography (>= 2.5.1)
- System.Diagnostics.DiagnosticSource (>= 8.0.1)
.NET Framework 4.8
- System.Configuration.ConfigurationManager (>= 8.0.0)
- System.Buffers (>= 4.5.1)
- K4os.Compression.LZ4.Streams (>= 1.3.8)
- Google.Protobuf (>= 3.30.0)
- BouncyCastle.Cryptography (>= 2.5.1)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
- System.Threading.Tasks.Extensions (>= 4.5.4)
- System.Diagnostics.DiagnosticSource (>= 8.0.1)
- ZstdSharp.Port (>= 0.8.5)
.NET 8.0
- BouncyCastle.Cryptography (>= 2.5.1)
- ZstdSharp.Port (>= 0.8.5)
- System.Text.Json (>= 9.0.0)
- System.Text.Encoding.CodePages (>= 8.0.0)
- System.Security.Permissions (>= 8.0.0)
- System.Threading.Tasks.Extensions (>= 4.5.4)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
- System.Diagnostics.DiagnosticSource (>= 8.0.1)
- System.Configuration.ConfigurationManager (>= 8.0.0)
- System.Buffers (>= 4.5.1)
- K4os.Compression.LZ4.Streams (>= 1.3.8)
- Google.Protobuf (>= 3.30.0)
- System.Runtime.Loader (>= 4.3.0)
Version | Downloads | Last updated |
---|---|---|
9.4.0 | 8 | 07/22/2025 |
9.3.0 | 19 | 04/16/2025 |
9.2.0 | 20 | 04/05/2025 |
9.1.0 | 16 | 04/08/2025 |
9.0.0 | 19 | 04/02/2025 |
8.4.0 | 17 | 04/08/2025 |
8.3.0 | 17 | 04/08/2025 |
8.2.0 | 13 | 04/08/2025 |
8.1.0 | 15 | 04/08/2025 |
8.0.33 | 17 | 04/08/2025 |
8.0.32.1 | 14 | 04/08/2025 |
8.0.32 | 16 | 04/09/2025 |
8.0.31 | 13 | 04/08/2025 |
8.0.30 | 15 | 04/08/2025 |
8.0.29 | 17 | 04/08/2025 |
8.0.28 | 16 | 04/08/2025 |
8.0.27 | 16 | 04/08/2025 |
8.0.26 | 13 | 04/08/2025 |
8.0.25 | 19 | 04/09/2025 |
8.0.24 | 15 | 04/08/2025 |
8.0.23 | 16 | 04/08/2025 |
8.0.22 | 19 | 04/08/2025 |
8.0.21 | 18 | 04/08/2025 |
8.0.20 | 14 | 04/08/2025 |
8.0.19 | 14 | 04/08/2025 |
8.0.18 | 19 | 04/08/2025 |
8.0.17 | 15 | 04/08/2025 |
8.0.16 | 16 | 04/08/2025 |
8.0.15 | 18 | 04/09/2025 |
8.0.14 | 17 | 04/08/2025 |
8.0.13 | 16 | 04/08/2025 |
8.0.12 | 21 | 04/09/2025 |
8.0.11 | 21 | 04/08/2025 |
6.10.9 | 16 | 04/09/2025 |
6.10.7 | 19 | 04/09/2025 |
6.9.12 | 18 | 04/08/2025 |
6.9.11 | 13 | 05/17/2025 |
6.8.8 | 15 | 04/09/2025 |
6.7.9 | 21 | 04/08/2025 |