MySQL Connector/C++ 2.0.3 m3 Development Release has been released

MySQL Connector/C++ 2.0.3 is the next development milestone of the MySQL Connector/C++ 2.0 series, and the first public release. Apart from covering more X DevAPI features, it adds a new, plain C API, called XAPI, that offers functionality similar to X DevAPI to applications written in plain C. Thus, not only can MySQL Connector/C++ be used to write C++ applications, as before.

Now, using the XAPI, MySQL Connector/C++ can be used to write plain C applications to access MySQL Database implementing a document store as well as execute traditional plain SQL statements. For more information about XAPI, refer to the documentation at

To learn more about how to write applications using the X DevAPI, see X DevAPI User Guide ( For more information about how to use Connector/C++ 2.0 and how the X DevAPI is implemented in it, see


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 Using MySQL as a Document Store (

To download MySQL Connector/C++ 2.0.3 m3, see the “Development Releases” tab at

X DevAPI Notes

New X DevAPI features added in this MySQL Connector/C++ release:

  • Methods for starting and controlling transactions
  • Using an X DevAPI URI or connection string to specify new session parameters
  • Capability of binding a session to the default shard and execute SQL statements there (using XSession.bindToDefaultShard())
  • Methods for counting elements in a table or collection
  • Access to multiple result sets if present in a query result
  • Methods to count items in a result set and fetch a complete result set at once (using fetchAll()), instead of accessing items one by one (using fetchOne())
  • Access to warnings reported when processing a statement (getWarnings())
  • Access to information about affected rows, generated auto-increment values, and identifiers of documents added to a collection

On Behalf of the MySQL/ORACLE RE Team

MySQL Connector/J 6.0.5 m4 Development Release has been released

Dear MySQL users,

MySQL Connector/J 6.0.5 m4 Development Release is a developer milestone
release for the 6.0.x series.
This release includes the following new features and changes, also described
in more detail on

As always, we recommend that you check the “CHANGES” file in the download
archive to be aware of changes in behavior that might affect your application.

To download MySQL Connector/J 6.0.5 M4, see the “Development
Releases” tab at


Changes in MySQL Connector/J 6.0.5 (2016-10-19, Milestone 4)

Version 6.0.5 Milestone is the forth development release of
the 6.0 branch of MySQL Connector/J, providing an insight
into upcoming features. It is suitable for use with MySQL
server versions 5.5, 5.6, and 5.7. It supports the Java
Database Connectivity (JDBC) 4.2 API.

Functionality Added or Changed

* Added support for the error codes of two MySQL server
rver.html#error_er_xa_rbtimeout) and ER_XA_RBDEADLOCK
rver.html#error_er_xa_rbdeadlock). (Bug #13702433, Bug

* X DevAPI: Client-side failover is now supported. It is
enabled by specifying multiple hosts in the X DevAPI
connection URL. See X DevAPI URL Format for more details.

* com.mysql.cj.core.MysqlType can now be used as
java.sql.SQLType in JDBC methods.

* X DevAPI: A new method, createTable(), has been added to
the Schema interface. See MySQL Connector/J X DevAPI
Reference ( for

* X DevAPI: A new method, bindToDefaultShard(), has been
added to the XSession interface. It creates a “virtual”
NodeSession instance, which shares the connection to the
router with the XSession that was used to create it. See
MySQL Connector/J X DevAPI Reference
( for details.

* X DevAPI: For any function that takes a value list of
parameters for its argument, there is now more
flexibility with how the parameters are to be specified:
they can now be supplied either as a value list or a list
of individual parameters.

* The Extension interface has been removed. Extension
classes now implement their own interfaces.

Bugs Fixed

* In certain cases, the exception interceptor was being
triggered twice in the internal SQLException factory
method. Also, if the exception interceptor returned an
exception with the cause already initialized, the same
factory method would fail to initialize the cause again,
and the real cause for the exception remained uncaptured.
(Bug #23743956)

* getLength() returned -1 for fields of the LONGBLOBL,
LONGTEXT, and GEOMETRY data types. This is due to the way
these data types are handled by protocol buffers, and
this fix makes the method return the right values. (Bug

* A memory leakage occurred when the connection properties
cachePrepStmts and useServerPrepStmts were both set to be
true and server-side prepared statements were set as
non-poolable, which resulted in the prepared statement
being not closable by the client, and the number of
prepared statements then kept on increasing.
When the memory leakage described above occurred, it did
not make Connector/J fail, as Connector/J switched to
using client-side prepared statements when the maximum
number of prepared statements was reached. However, when
rewriteBatchedStatements was also set to true, the switch
to client-side prepared statements did not occur, and
Connector/J threw the MySQLSyntaxErrorException (“Can’t
create more than max_prepared_stmt_count statements”)
when the client wanted to create more prepared statements
than allowed.
This fix corrected the way prepared statements are
handled in order to avoid both of the problems described
above. (Bug #22954007, Bug #80615)

* ResultSet.getString() sometimes returned garbled data for
columns of the JSON data type. This was because JSON data
was binary encoded by MySQL using the utf8mb4 character
set, but decoded by Connector/J using the ISO-8859-1
character set. This patch fixes the decoding for JSON
data. Thanks to Dong Song Ling for contributing to the
fix. (Bug #22891845, Bug #80631)

* When Connector/J retrieved the value of a BIT column as a
string using, for example, getString(), it returned the
wrong string if the BIT value happened to be equivalent
to the decimal value of some ASCII character. This was
because Connector/J treated the BIT value as a character
code; thus, for example, the value “01100001” (decimal 97
in binary) was interpreted as the character “a” (whose
ASCII value in decimal is 97), which was returned by the
function. This fix corrected the parsing behavior of
Connector/J on BIT values, so that a string
representation of the number (“97” in the last example)
is returned by getString(). (Bug #21938551, Bug #78685)

* When the connection property useLocalTransactionState was
set to “true” and autocommit was set to “false” on the
server, if any exception was thrown, any further calls
for rollback() or commit() were not sent to the server.
It was because when there was an exception while
executing a query, Connector/J lost the information
regarding the server’s transaction state. This patch
fixes this issue by preserving the previous transaction
state for the current connection when any exception is
thrown. (Bug #20212882, Bug #75209)

* An invalid connection URL caused Connector/J to throw a
NullPointerException. With this fix, an SQLException is
thrown instead in the situation. (Bug #18759269, Bug

* When a very large amount of compressed data is
transmitted from the server to the client and under very
special circumstances, a CommunicationsException might
occur. It happened when a single compressed packet from
the server was not big enough to provide an entire
uncompressed packet to the client side. With this fix,
Connector/J reads as many compressed packets as necessary
to fill the size of the uncompressed packet that was
being requested. Thanks to Ryosuke Yamazaki for
contributing to the fix. (Bug #11756431, Bug #48346)


Reporting Bugs
We welcome and appreciate your feedback and bug reports:

On behalf of the MySQL Release Team
-Sreedhar S

MySQL Connector/Node.JS 1.0.4 now on

MySQL Connector/Node.JS 1.0.4 was recently released as a development milestone release. This is the first version available via is the central registry for Node.JS packages. This and potential future official MySQL packages can be found using the @mysql organisation. For this to work we had to change the package name to contain that prefix and have chosen the name @mysql/xdevapi as this package provides the implementation of our X DevAPI for Node.JS and we have a free namespace for potential future libraries as part of our Connector/Node.JS product.


Given an existing Node.JS project we can easily install the library:

As presented with previous releases the implementation is built around Promises. After the installation it’s easy to ask for a session:

If the MySQL Server is running and the X Plugin was loaded this Promise object will resolve to a session, else it will be rejected.

As a new feature in 1.0.4 the connection parameters can also be provided in form of an URL. As the URL is defined in the X DevAPI it can be shared among applications using different languages and MySQL Connectors:

Another new feature in MySQL Connector/Node.JS is support for view DDL operations. To create a view a CRUD select object can be used:

In case the view isn’t needed anymore it can of course be dropped again:

For information purpose another addition are functions to gather row or document counts from tables or collections:

For the future there’s more to come. We’re working on different improvements to the API and performance. More on this in a later post.

MySQL Connector/Python 2.1.4 GA has been released

The MySQL Connector/Python Team is pleased to announce the newest MySQL Connector/Python 2.1.4, the second GA version of 2.1 release series of the pure Python database driver for MySQL.

This release includes a number of improvements for usability, stability and security.

Changes in MySQL Connector/Python 2.1.4 GA

Security Notes

The linked OpenSSL library for Connector/Python Commercial has been updated to version 1.0.1q. Issues fixed in the new OpenSSL version are described at This change does not affect Oracle-produced MySQL Community builds of Connector/Python, which use the yaSSL library instead.
The change also does not affect connections made using any pure Python implementation of Connector/Python, for which the version of OpenSSL used is whatever is installed on the system.

Bugs fixed

  • Connector/Python failed to establish connections using the cleartext client-side authentication plugin for accounts using the PAM server-side authentication plugin. Thanks to Daniël van Eeden for the patch. (Bug #22873551, Bug #80609)
  • A potential SQL injection vector was eliminated. (Bug #22529828)
  • Connections made using the C Extension failed when the ssl_ca parameter was given without ssl_cert and ssl_key. (Bug#21879914, Bug #79835, Bug #22494320)
  • For connections made with consume_results=True, consume_results was reset to False after callproc() execution failure. (Bug #21879859) References: This issue is a regression of: Bug #21492815.
  • In connections for which compress=True, LOAD DATA LOCAL INFILE statements produced “Packets out of error” errors. (Bug#21449996)
  • Attempts to insert Python ByteArray data into binary table columns failed. (Bug #77822, Bug #21498719)

Quick links

Release Notes:
Feedback, bugs and feature requests:
On GitHub:


Thank you all for your support and feedback!

On behalf of the MySQL Connector/Python Team.

MySQL for Visual Studio 2.0.4 has been released

The MySQL Windows Experience Team is proud to announce the release of MySQL for Visual Studio 2.0.4 m3. Note that this is a development preview release and not intended for production usage.

MySQL for Visual Studio 2.0.4 m3 is the third development preview release of the MySQL for Visual Studio 2.0 series.  This series adds 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 MySQL for Visual Studio, and its usage, 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

You can download MySQL Installer from our official Downloads page at

MySQL for Visual Studio 2.0.4 m3 can also be downloaded by using the product standalone installer found at, under the tab “Development Releases”.

Changes in MySQL for Visual Studio 2.0.4 m3

What’s new in 2.0.4 m3

  • Enhanced the logic that migrates stored MySQL connections to the MySQL Workbench connections.xml file. In previous versions, the migration was offered and if not done at that moment, the dialog to migrate was shown every time the MySQL Connections Manager dialog was shown, but there was no way to choose to remain storing MySQL connections in the MySQL for Visual Studio configuration folder instead of merging them with MySQL Workbench.  Now, the connection migration dialog offers a way to postpone the migration by either 1 hour, 1 day, 1 week, 1       month or indefinitely. If the migration is postponed, the dialog is shown again after that time elapses. If it is postponed indefinitely, then an option is added to the MySQL Connections Manager dialog that permits the connection migration to be done manually, as long as MySQL Workbench is installed.
  • When the MySQL Script Editor window is opened (either by selecting SQL, JavaScript, or Python from the New MySQL Script menu), the Results area was visible showing a big gray area in the editor, despite having nothing to display. Now, this area is hidden until results are ready to display, which happens after clicking Run.
  • The SQL syntax parser was updated to handle the optimizer hints that were introduced in MySQL 5.7.7.
  • The SQL editor was updated to check the syntax of a script before sending the statements to the server. If syntax errors are present, the Visual Studio Output pane displays the errors and the script is not executed.
  • A drop-down list of connections was added in the MySQL editor toolbar to enable fast switching among connections while editing SQL, JavaScript, and Python scripts. The list, located next to the Connect to MySQL button, shows all Server Explorer connections for the MySQL data provider with compatible protocol       support.  Note JavaScript and Python editors show only the connections that support the X Protocol.

Bugs Fixed

  • MySQL Workbench was unable to open connections added from the MySQL Connection Manager, as executing them would emit the following error: “Cannot connect to Database Server”. This is because an invalid “socket=.” value was added to the connection definition. To solve this, MySQL for Visual Studio was updated to use the latest MySQL.Utility version, which fixes code in the MySQL Workbench class to only write the socket value into the XML nodes if the connection is of type Sockets or Pipe.
    • Bug #24666952
  • After connections were added to the Server Explorer through the MySQL Connections Manager, clicking Refresh on the Server Explorer toolbar caused the refresh operation to hang, and nothing else could be done within the Server Explorer pane. Clicking Cancel Refresh was required to fix this.
    • Bug #24666931
  • SHOW statements executed from the SQL editor failed to display the expected output.
    • Bug #24622881
  • Queries executed from the SQL editor against nonunique data in NoSQL tables emitted error messages and failed to return result sets.
    • Bug #24462707
  • The main XML element in %APPDATA%\Oracle\MySQL For Visual Studio\settings.config was renamed to MySQLforVisualStudio from MySQLForExcel. Indentations were added to improve the overall readability of configuration settings.
    • Bug #24291264
  • JavaScript and Python editors permitted connections to versions of MySQL that did not support the X Protocol if those connections were unnamed or temporary, but the scripts did not work properly. This fix adds validation to ensure that all connections related to JavaScript and Python scripts are to servers with the X Plugin enabled.
    • Bug #24290570
  • Selecting the New MySQL Script context-menu option by right-clicking a Server Explorer connection in Visual Studio emitted an error if the connection was first closed and then opened.
    • Bug #24064816
  • Visual Studio was unable to open a design window for any selected table in a MySQL database.
    • Bug #23642010
  • Opening a new MySQL script file from the Visual Studio File > New menu displayed the following error: “Object reference not set to an instance of an object”.
    • Bug #23619311
  • Processing a Result object from the X Protocol substituted an error or information message in place of some collection output.
    • Bug #22983803
  • Advanced, Connect, and Cancel buttons were missing from the Connect to MySQL dialog for connections made from the script editor window.
    • Bug #22114315
  • Dragging and dropping a table from the Server Explorer in Visual Studio to a project would fail with the following error: “Some updating commands could not be generated automatically. The database returned the following error: You have a usable connection already”. After clicking OK, Visual Studio would emit the following error “Mouse drag operation failed. Could not retrieve schema information from table or view”. To solve this issue, MySql.Data was updated to version 6.9.9.
  • From the Query Designer, selecting Verify SQL Syntax would always display “Not supported by the provider” instead of verifying the SQL syntax.
  • The Python code editor displayed session options for JavaScript instead of options for the Python language.
  • In some cases, selecting Retrieve Data for a table with a valid connection failed to populate the table with data.

Quick links

Enjoy and thanks for the support!

MySQL for Visual Studio Team.

MySQL Connector/J 5.1.40 has been released

I’m pleased to announce the newest MySQL Connector/J 5.1 Maintenance Release.

As usual, MySQL Connector/J 5.1 can be downloaded from the official distribution channels MySQL Downloads and The Central Repository. The commercially licensed version is available for download at My Oracle Support.

Please don’t forget to consult the CHANGES file in the download archive and/or the release notes page to know what is new and if there are any changes that might affect your applications.

MySQL Connector/J 5.1.40 is the official JDBC driver for MySQL databases and, as such, we are continuously working to make it better, more reliable and faster. This new version delivers several bug fixes and upgrades. This is the current recommend  version and you should upgrade to it as soon as possible.

I’d like to highlight the most relevant fixes and improvements in this release:

Recovered & new features

Previous versions used to silently disable local transaction states management (connection property useLocalTransactionState=true) when server side query cache was enable. This used to be workaround for a know server bug that it’s long time gone. The workaround in Connector/J side, though, survived till these days. I’m pretty sure that the effects will be almost unnoticed but certainly this helps empowering the developer and provides better control over the Connector.

The XA errors mapping in Connector/J was updated with the missing error codes that the server may throw back.

MySQL Fabric support issues

Connector/J 5.1 maintains support for MySQL Fabric, as such, this release comes with a couple fixes to it. Fabric connections are especially prone to problems as they rely on both a connection to a Fabric node and multiple connections to MySQL servers while having to be able to refresh themselves to topology changes, failures and such. A couple of issues caused by communication failures to the Fabric node are now fixed.

Continuous improvement of MySQL data types support

The JSON data type is relatively new in Connector/J. As such, every now and then there is something that needs to be fixed or adjusted. This time it was an encoding issue observed when the JSON strings contained non Latin characters. Additionally, the specific combination of updatable result sets with cursor based fetches was missing the support for the JSON type.

Getting data from BIT columns as numeric values was behaving inconsistently when binary values and ASCII values of numbers matched. As a result, instead of the expected value, it was occurring an extra conversion to String before the data was returned. Also fixed in this release.

Improved internals

Although we aim to, it’s almost impossible to guarantee that the code is free from memory leaks, deadlocks, NPEs and so on. A few of those where caused by some bugs that are now fixed.

Under certain situations the exception interceptor mechanism was being triggered twice. This, not only caused an unwanted additional  processing, but also was hiding the real cause that triggered the interceptor.

Client-side caching of prepared statements while using server-side prepared statements requires extra care because it can easily be a source of memory leaks, both on client and server sides. In this particular scenario, setting a statement as non-poolable was causing a never ending number of prepared statements on server and never deallocated. Per se, this wasn’t a problem for the driver because it is prepared to switch-over to client prepared statements as soon as it is unable to create more on the server, but it wasn’t the desired behavior for sure.

Transactions states managed locally got fixed for when there were exceptions while on the middle of one. Without the fix the rollback and commit wasn’t operating as expected.

The database connection URL syntax got support for several extensions over the year. With that also increased the corner cases that its parsers have to deal with. A couple of them were fixed in this release, specifically a NPE and an incompatibility with host names starting with the word “address”.


Enjoy this new Connector/J release. Get the most out of it by reading its official documentation or by getting the developer’s support directly from the forum channel.

Special thanks to Dong Song Ling and Ryosuke Yamazaki for their valuable contributions.

Thank you all for your support and feedback, and keep in touch!

On behalf of the MySQL Connector/J Team

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.