This project has moved. For the latest updates, please go here.

Frequently Asked Questions (FAQ) - Commonly Seen Error


  1. Cannot connect to website database. An exception Occur: Unable to connect to any of the specified MySQL hosts.
  2. MySql.Data.Types.MySqlConversionException: Unable to convert MySQL date/time value to System.DateTime.
  3. How do I get notified if there is new release?
  4. Connection Timeout Error - Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
  5. Error - Packets larger than max_allowed_packet are not allowed.
  6. Pre-compiled or NuGet package is not signed. Can I get a signed version of DLL of MySqlBackup.NET?
  7. UTF8 characters are not shown properly

1. Cannot connect to website database. An exception Occur: Unable to connect to any of the specified MySQL hosts

By default, MySql at web hosting will only allow connection from "localhost". If you wish to connect to MySql using your computer (remote access), or other IP, you have to allow the MySql at your website to be connected by the specific IP (your IP). If the website is using CPanel, you may refer this guide:
2. MySql.Data.Types.MySqlConversionException: Unable to convert MySQL date/time value to System.DateTime

This is not a bug. It is an expected behaviour. MySQL allow zero date time which means 0 year 0 month and 0 days, but in .NET world's concept, there is no such 0 year, 0 month and 0 day. The minimum possible date in .NET is 01-01-01. (Commonly occur when data type of "DATE" (not DATETIME) used in one of the table).

There are 2 ways to resolve this:

1st, by adding allowzerodatetime in the MySQL connection string (Recommended if you use MySqlBackup)
  • Example: server=localhost;user=root;pwd=qwerty;database=test;allowzerodatetime=true;
2nd, by adding convertzerodatetime in MySQL connection string.
  • Example: server=localhost;user=root;pwd=qwerty;database=test;convertzerodatetime=true;
Using convertzerodatetime will convert null date in MySQL into DateTime.MinValue (0001-01-01 00:00:00) in .NET Language.
3. How do I get notified if there is new release?

You can, by signing up the release notification at [Download] Section.
4. Connection Timeout Error - Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

The default connection time of MySqlConnection is 15 seconds. You can extend it to a longer time. For example:
  • server=localhost;user=root;pwd=1234;database=test;timeout=120;
Read More: http://dev.mysql.com/doc/refman/5.6/en/connector-net-connection-options.html
5. Error - Packets larger than max_allowed_packet are not allowed.

Read more >> Error - Packets larger than "max_allowed_packet" are not allowed


6. Pre-compiled or NuGet package is not signed. Can I get a signed version of DLL of MySqlBackup.NET?

In stead of signing MySqlBackup.NET, why not just include the source code directly into your project. MySqlBackup.Net is all written in C#. It is not a very large and complicated project. It can be simply just add all the source code into your project directly.

Or if you still need a signed MySqlBackup.NET, just recompile the project and sign it to your flavor.
7. UTF8 characters are not shown properly

Discussion/Issues:
  1. Fields with accented letters
  2. strange characters after restore using charset=utf8
  3. incorrect display of characters UTF8

The problem is not coming from MySqlBackup.NET, it is from MySql dot Net Connector (MySql.Data.DLL). I'm still looking forward for a solution for this matter.

I had posted a question at StackOverFlow.com - MySQL - Return Incorrect UTF8 characters.
Hoping that some experts will share their insights.

As for current solution, if your are using utf8 characters, create your database with Default Character Set of UTF8. It seems that MySql.Data.DLL works best with database characters that is encoded in utf8.

Last edited Mar 23 at 4:22 AM by adriancs, version 15