6 messages in com.mysql.lists.dotnetRe: Illegal mix of collations
FromSent OnAttachments
nil...@aon.at28 Oct 2004 14:48 
Bekkers, Kris31 Oct 2004 09:33 
Vilhelm Heiberg03 Nov 2004 02:53 
Bekkers, Kris03 Nov 2004 04:51 
Ben Reichelt13 Nov 2004 15:08 
Reggie Burnett14 Nov 2004 06:59 
Subject:Re: Illegal mix of collations
From:Ben Reichelt (ben.@gmail.com)
Date:11/13/2004 03:08:32 PM
List:com.mysql.lists.dotnet

I dont think this is a bug. I just downloaded mysql 4.1.7 with .net beta 2 and I ran into the same problem you are having. I think the problem is that the connection is trying to speak utf8 while the default collation on the database is latin1. When I view my tables in mysql_cc, the comments field says 'latin1_swedish_ci', and if you do a 'Show Create' on the table, this is the last line:

) ENGINE=MyISAM DEFAULT CHARSET=latin1;

So, to fix the problem, I copied the create scripts for all my tables, and changed the last line of each table to this:

) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

After I made this change my connection worked fine. Hope this helps

ben

On Wed, 3 Nov 2004 13:51:27 +0100, Bekkers, Kris <kris@atosorigin.com> wrote:

Hi,

I reported this as a "bug" a couple of days ago but no answer yet.

Kris

-----Oorspronkelijk bericht----- Van: Vilhelm Heiberg [mailto:vilh@exor.no] Verzonden: wo 3/11/2004 11:53 Aan: dot@lists.mysql.com CC: Onderwerp: Illegal mix of collations

I also get the "Illegal mix of collations" error message. Now we are at least 4 who has reported this problem the last few days.

I also use .Net Connector Beta 2, and I use MySQL 4.1.3b.

It is some fairly simple SQL code:

public ArrayList GetCustomers(string prefix) { MySql.Data.MySqlClient.MySqlConnection connection; connection = new MySqlConnection(CONNECTIONSTRING); connection.Open();

string stmt; stmt = "SELECT id,name "; stmt += "FROM customer "; stmt += "WHERE name like '" + prefix + "%' ";

MySqlCommand cmd = new MySqlCommand(stmt, connection); MySqlDataReader reader = cmd.ExecuteReader();

Any solution would be appreciated.

Vilhelm Heiberg Exercise Organizer AS vilh@exor.no