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

No packages depend on MySql.Data.

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.0.0 1 10/06/2024
8.4.0 0 04/30/2024
8.3.0 0 01/16/2024
8.2.0 0 10/25/2023
8.1.0 0 07/18/2023
8.0.33 0 04/18/2023
8.0.32.1 0 03/08/2023
8.0.32 0 01/17/2023
8.0.31 0 10/11/2022
8.0.30 0 07/26/2022
8.0.29 0 04/26/2022
8.0.28 0 01/21/2022
8.0.27 0 10/19/2021
8.0.26 0 07/20/2021
8.0.25 1 10/06/2024
8.0.24 0 04/20/2021
8.0.23 0 01/18/2021
8.0.22 0 10/19/2020
8.0.21 0 07/13/2020
8.0.20 0 04/27/2020
8.0.19 0 01/13/2020
8.0.18 0 10/14/2019
8.0.17 0 07/22/2019
8.0.16 0 04/26/2019
8.0.15 0 02/01/2019
8.0.14 0 01/22/2019
8.0.13 0 10/22/2018
8.0.12 0 07/27/2018
8.0.11 0 04/19/2018
6.10.9 0 07/29/2019
6.10.7 0 04/30/2018
6.9.12 0 05/04/2018
6.8.8 0 06/27/2016
6.7.9 0 10/14/2015