MySql.Data 9.0.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);
    }

Contributing

There are a few ways to contribute to the Connector/NET code. Please refer to the contributing guidelines for additional information.

Additional Resources

Showing the top 20 packages that depend on MySql.Data.

Packages Downloads
sqlSugarCore
.Net Core 2.0 SqlSugar ORM ,High-performance, lightweight https://github.com/sunkaixuan/SqlSugar
4
sqlSugarCore
.Net Core 2.0 SqlSugar ORM ,High-performance, lightweight https://github.com/sunkaixuan/SqlSugar
3
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 .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/net5 SqlSugar ORM ,High-performance, lightweight https://github.com/sunkaixuan/SqlSugar
3
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

Review ReleaseNotes.txt for details.

.NET Framework 4.6.2

.NET Framework 4.8

.NET 6.0

.NET 8.0

.NET Standard 2.0

.NET Standard 2.1

Version Downloads Last updated
9.5.0 2 2025/10/24
9.4.0 7 2025/7/23
9.3.0 5 2025/6/21
9.2.0 2 2025/8/25
9.1.0 2 2025/8/25
9.0.0 2 2025/8/25
8.4.0 2 2025/8/25
8.3.0 2 2025/8/25
8.2.0 2 2025/8/25
8.1.0 3 2025/8/25
8.0.33 2 2025/11/19
8.0.32.1 3 2025/7/10
8.0.32 2 2025/8/25
8.0.31 3 2025/8/25
8.0.30 1 2025/11/19
8.0.29 1 2025/11/19
8.0.28 1 2025/11/19
8.0.27 2 2025/8/25
8.0.26 1 2025/11/19
8.0.25 1 2025/11/19
8.0.24 2 2025/8/25
8.0.23 1 2025/11/19
8.0.22 3 2025/8/25
8.0.21 2 2025/11/19
8.0.20 1 2025/11/19
8.0.19 1 2025/11/19
8.0.18 1 2025/11/19
8.0.17 1 2025/11/19
8.0.16 1 2025/11/19
8.0.15 2 2025/11/19
8.0.14 1 2025/11/19
8.0.13 2 2025/8/25
8.0.12 1 2025/11/19
8.0.11 1 2025/11/19
6.10.9 2 2025/8/13
6.10.7 2 2025/8/25
6.9.12 3 2025/8/25
6.8.8 2 2025/8/25
6.7.9 2 2025/8/25