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);
    }

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
TestContainers
Package Description
69
TestContainers
Package Description
65
TestContainers
Package Description
51
TestContainers
Package Description
50
TestContainers
Package Description
40
TestContainers
Package Description
37
TestContainers
Package Description
33
MySql.Data.EntityFrameworkCore
MySql.Data.EntityFrameworkCore for Entity Framework.
21
MySql.Data.EntityFrameworkCore
MySql.Data.EntityFrameworkCore for Entity Framework.
19
MySql.Data.EntityFrameworkCore
MySql.Data.EntityFrameworkCore for Entity Framework.
18
MySql.Data.EntityFrameworkCore
MySql.Data.EntityFrameworkCore for Entity Framework.
17
MySql.Data.EntityFrameworkCore
MySql.Data.EntityFrameworkCore for Entity Framework.
16
MySql.Data.EntityFrameworkCore
MySql.Data.EntityFrameworkCore for Entity Framework.
15
MySql.Data.EntityFrameworkCore
MySql.Data.EntityFrameworkCore for Entity Framework.
14
MySql.Data.EntityFrameworkCore
MySql.Data.EntityFrameworkCore for Entity Framework.
13

Review ReleaseNotes.txt for details.

.NET Framework 4.6.2

.NET Standard 2.0

.NET 8.0

.NET 7.0

.NET Standard 2.1

.NET 6.0

.NET Framework 4.8

Version Downloads Last updated
9.4.0 2 07/26/2025
9.3.0 8 04/16/2025
9.2.0 12 02/16/2025
9.1.0 18 11/21/2024
9.0.0 16 08/10/2024
8.4.0 36 05/01/2024
8.3.0 21 02/15/2024
8.2.0 22 02/17/2024
8.1.0 19 02/14/2024
8.0.33 23 08/27/2023
8.0.32.1 22 08/28/2023
8.0.32 21 08/31/2023
8.0.31 16 08/27/2023
8.0.30 22 09/01/2023
8.0.29 21 08/29/2023
8.0.28 18 08/26/2023
8.0.27 20 08/27/2023
8.0.26 22 03/20/2023
8.0.25 19 08/27/2023
8.0.24 20 02/17/2024
8.0.23 23 08/29/2023
8.0.22 23 12/20/2020
8.0.21 23 06/28/2022
8.0.20 20 08/29/2023
8.0.19 23 08/27/2023
8.0.18 22 08/26/2023
8.0.17 19 08/31/2023
8.0.16 17 08/25/2023
8.0.15 21 08/31/2023
8.0.14 23 08/29/2023
8.0.13 21 08/26/2023
8.0.12 22 08/29/2023
8.0.11 23 08/30/2023
6.10.9 16 08/29/2023
6.10.7 18 08/26/2023
6.9.12 18 08/25/2023
6.8.8 22 06/13/2023
6.7.9 19 06/12/2023