MySQL Connector/NET 7.0.5 m4 Development Release has been released

Dear MySQL users,

MySQL Connector/Net 7.0.5 is the second development release that expands cross-platform support to Linux and OS X when using Microsoft’s .NET Core framework. Now, .NET developers can use the X DevAPI with .NET Core and Entity Framework Core (EF Core) 1.0 to create server applications that run on Windows, Linux and OS X. We are very excited about this change and really look forward to your feedback on it!

MySQL Connector/Net 7.0.5 is also the fourth development release of MySQL Connector/Net to add support for the new X DevAPI.  The X DevAPI enables application developers to write code that combines the strengths of the relational and document models using a modern, NoSQL-like syntax that does not assume previous experience writing traditional SQL.

To learn more about how to write applications using the X DevAPI, see For more information about how the X DevAPI is implemented in Connector/Net, see

Please note that the X DevAPI requires at least MySQL Server version

5.7.12 or higher with the X Plugin enabled. For general documentation about how to get started using MySQL as a document store, see

To download MySQL Connector/Net 7.0.5 M4, see the “Development Releases” tab at

Changes in MySQL Connector/Net 7.0.5 (2016-09-06, Milestone 4)

Functionality Added or Changed

  • Added support for snapshot change-tracking by recording the original values of an entity when it is retrieved from the database, and support to access the tracked state of entities through DbContext.Entry and DbContext.ChangeTracker.
  • Added concurrency tokens and shadow properties to the set of conventions used to build an Entity Framework Core model based on the shape of entity classes.
  • The .NET Core version of the driver now supports connections to MySQL servers configured to use SSL (TSL for 5.7) through the MySqlConnection class or a DbContext with Entity Framework 6.x or Entity Framework Core.
  • Entity Framework Core support for eager loading can be used to load related data from MySQL as part of the initial query.
  • Added X DevAPI support for following connections options:
    • ssl-enable: enables the use of SSL as required. mysqlx://user:password@
    • ssl-ca: path to a local file that contains a list of trusted TLS/SSL CAs as PFX file. This option uses an implicit ssl-enable. mysqlx://\cas.pfx)
    • ssl-ca-pwd: specifies the CA certificate password. mysqlx://\cas.pfx)&ssl-ca-pwd=password

Nuget packages are available at:

MySql.Data package. Compatible with .NET 4.5.1 and Core framework 1.0

MySql.Data.EntityFrameworkCore. Compatible with .NET 4.5.1 and Core framework 1.0

MySql.Web. Compatible with .NET 4.5.1

MySql.Data.Entity Compatible with .NET 4.5.1

We love to hear your thoughts or any comments you have about our product. Please send us your feedback at our forums, fill a bug at our community site, or leave us any comment at the social media channels.

Enjoy and thanks for the support!

On behalf of the MySQL Connector/Net team


MySQL Connector/J 6.0.4 has been released

We are pleased to announce the next development release of MySQL Connector/J 6.0 which supports both JDBC 4.2 API and the new X DevAPI.

MySQL Connector/J 6.0.4 can be downloaded from the official distribution channels MySQL Downloads (see the “Development Releases” tab) and The Central repository. MySQL Connector/J source is also available on GitHub.

As always, we recommend that you check the CHANGES file in the download archive and/or the release notes to be aware of changes in behavior that might affect your application.

For documentation please visit the MySQL Connector/J 6.0 Developer Guide.

Note that Connector/J 6.0.4 is a milestone release and not intended for production usage.

I’d like to highlight the most important changes in this release:

X DevAPI connection string

The prefix used in connection string for X DevAPI is now unified between MySQL connectors. The “mysql:x:” we used in previous Connector/J 6.0 releases doesn’t work anymore, please use the “mysqlx:” one to establish XSession:

X DevAPI support for views

The com.mysql.cj.api.x.Table interface now represents both database tables and views. Schema.getTables() returns a list of Table objects for each existing database Table and View. Schema.getTable(name) also returns a Table object if the object with a given name is a View.

A new Table interface method was added:

The com.mysql.cj.api.x.View interface existed in previous Connector/J 6.0 releases isn’t available in Connector/J 6.0.4.

MySQL server compliance

MySQL Connector/J 6.0.4 is suitable for use with MySQL server versions 5.5, 5.6, and 5.7 via Java Database Connectivity (JDBC) 4.2 API.

Due to changes in X Protocol implementation MySQL Connector/J 6.0.4 requires at least MySQL 5.7.14 server when working via X DevAPI.


Enjoy this new Connector/J and thank you all for your support!

On behalf of the MySQL Connector/J Team.

MySQL Connector/NET for .NET Core 1.0

.NET Core and MySQL Connector/NET

It is exciting times!  Recently Microsoft released .NET Core 1.0, a cross platform implementation of the .NET Framework.  .NET Core works on Windows, Mac OS, and Linux and is fully open source!

We wanted to enable users of Connector/Net to be able to use .NET Core so we have been working hard for the past few months to make our provider fully .NET Core compatible.  Because .NET Core does not yet fully replace the traditional .NET Framework, we will continue to ensure our provider is compatible with both frameworks.

Along with these exciting changes, we are also including in our most recent release support for Entity Framwork 7.0  and Entity Framework Core 1.0.

In this article I will explain how to install and setup .NET Core and how to make a simple sample that connects and retrieve data in screen.


Further information about this new framework, API, etc. can be found on the product website


The SDK and dotnet CLI is available for all the supported platforms (see the website to know the list of specific platforms supported).  Visual Studio Code (available at is a new, fully open source editor that works on Windows, Mac, and Linux and provides a nice GUI for editing, compiling, and even debugging your project.  When installing Visual Studio Code, be sure and install the plugin for C#.  This will enable compiling and debugging of C# projects.

Installing on Windows

The installation guide followed in this page is

You could install only the .NET Core 1.0 SDK and use Visual Studio Code.  The download for the .NET Core 1.0 SDK is at

If you are on Windows you can choose to use Visual Studio 2015.  If you do not wish to purchase Visual Studio 2015, you can use the Community Edition which can be found at

To work with .NET Core projects you ‘ll want to make sure you are using Update 3 for Visual Studio 2015.  That can be found at  Also, there is a separate download to provide some “tooling” for using in Visual Studio 2015.  That can be found at

Install on Linux

.NET Core 1.0 is compatible with serveral Linux variants.  We will explain how to install it for Ubuntu (14.04 or 16.04, 15.04 it is not supported) or Linux Mint 17 and the guide used is here

Other Linux distributions are supported, follow the guide from the .NET Core website

Add the dotnet apt-get feed

First we need to set up the apt-get feed

Ubuntu 14.04/Linux Mint 17

Ubuntu 16.04


If you have any previous versions of the .NET Core is necessary to run this script to remove any previous version.  It is important to do this before you continue.

Use apt-get to install the .NET Core

Install on Mac OS

The guide used is here

It is necessary to have the latest version of OpenSSL installed.  The easiest way is installing Homebrew.  Please follow the guide from here

After installing Homebrew execute the following command

.NET Core SDK (Mac OS)

Download and execute the installer from here


Now that the SDK is installed we can proceed to create a sample project. You could use Visual Studio 2015 or Visual Studio Code.

There are two different kind of projects for Core, Library and Console app.  So far .NET Core doesn’t have support for GUI style applications. The sample we will create now is a console app

If you are using Visual Studio 2015 then create a new project of type “Console Application (.NET Core)”, type the name of the project and click the “Ok” button

Select Kind of project (.NET Core)

If you want to create using dotnet CLI and VS Code, open a prompt command, create a new folder for your project, change to that folder and create the project.


After the project was created, it is necessary to do a “restore” ir order to download the dependencies

For Visual Studio 2015 click with Right button in the project and click in the menu “Restore Packages”

For dotnet cli/VS Code

After this compile your project in Visual Studio 2015 or run the “build” command using dotnet cli

And last for execute this sample hit F5 on Visual Studio 2015 or use the “run” command for cli

You should now see the output “Hello World!”

We have now a really basic app.  Now lets add some code and a reference to the MySQL Connector for .NET Core  dependency.  We will continue using the dotnet cli and VS  Code for the rest of this article.

Open the directory in the Visual Studio Code.  We will see two files, program.cs and project.json

The project.json is our configuration project file and is where we have the project properties like name, version, author.  Also we set the build and pack options  We establish the framework targets and their specific configurations like the dependencies.

Our recently created project has a “project.json” file that should look like this

In order to make a connection to a MySQL Server we need to add a reference to the MySQL Connector for .NET Core.  We will add the dependency after the Microsoft.NETCore.App dependency.  Notice that we could also add the the dependency as a general dependency that doesn’t depend on the target (in the empty section “dependencies” before the frameworks section.  This is up to you and your needs.

Lets consider that we have a MySQL server up and running and it has the Sakila sample database configured.  If you need to setup the database, sql script could be found here

After we change the dependencies, we must do a restore again in order that .NET Core downloads the NuGet package and we can use the it.

Now open program.cs and add a using statement to the MySql.Data.MySqlClient namespace and add code for create and open a connection

Now lets add code to get information from “Category” table from Sakila database

This is all that we need to retrieve data from the server in a simple sample.  Let’s do a build and then run the sample (if didn’t do a restore then that is the first thing we should do)

The output will be something like this


Hope this simple sample helps you.  While this post was written on Windows, the command line steps and code should work the same on Linux and Mac.