Bug #68930 Unkown column '***' in 'field list'
Submitted: 11 Apr 2013 9:59 Modified: 11 Jul 2013 20:04
Reporter: Gu Mingfei Email Updates:
Status: No Feedback Impact on me:
None 
Category:Connector / NET Severity:S1 (Critical)
Version:5.2.7 and 6.6.5 OS:MacOS (10.7.5)
Assigned to: Assigned Account CPU Architecture:Any

[11 Apr 2013 9:59] Gu Mingfei
Description:
When I use C# to connect to  "5.6.10 MySQL Community Server (GPL)",
 1. in the Mono Develop building output:
      Unhandled Exception: System.IO.FileLoadException: The assembly name is invalid.
    at System.Reflection.AssemblyName..ctor (System.String assemblyName) [0x00000] in <filename       unknown>:0 
  at Mono.CSharp.ImportedAssemblyDefinition.ReadAttributes () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.MetadataImporter.GetAssemblyDefinition (System.Reflection.Assembly assembly) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.ReflectionImporter.ImportAssembly (System.Reflection.Assembly assembly, Mono.CSharp.RootNamespace targetNamespace) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.DynamicLoader.LoadReferences (Mono.CSharp.ModuleContainer module) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Driver.Compile () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in <filename unknown>:0 

 2.and in Unity3D(IDE)  , the error as following :
   MySqlException: Unknown column 'px_3d' in 'field list'
   MySql.Data.MySqlClient.MySqlStream.ReadPacket ()
   MySql.Data.MySqlClient.NativeDriver.GetResult (System.Int32& affectedRow, System.Int64& insertedId)

First I check my table and column name , it's no problems;
And I copy the sql to run it under command line , it works OK , but it doesn't work when I use it with C# under Mono Develope.

Can you give me a full repsonse as quickly as possible, thanks!
and my mailbox is gmf532196@163.com

How to repeat:
Developing Unity3D Application ,and using mysql-connector-.Net to connect to Database.
[11 Jun 2013 19:59] Francisco Alberto Tirado Zavala
Hello.

Please, can you give more information about how you are trying to do the connection or the query you want to execute?
Are you specifying the DataBase to be used in the connection string or in the query you are executing?

I was able to get connected to the DataBase and get data using the following code:

using UnityEngine;
using System;
using System.IO;
using System.Collections;
using System.Data.Common;
using MySql.Data.MySqlClient;

public class MySqlCS : MonoBehaviour {
	
	private static MySqlConnection dbConnection;
	// Use this for initialization
	void Start () {
		string connectionString = "Server=localhost;" +
            "Database=mytest;" +
            "User ID=root;" +
            "Port=3305;" + //port configured for test purposes, can be omitted
			//"Password=;" //no password configured for test purposes
            "Pooling=false";
        dbConnection = new MySqlConnection(connectionString);
		
		try
		{
	        dbConnection.Open();
	        Debug.Log(string.Format("Conn State:{0} | Server Version:{1} | Server Thread:{2} | Ping?:{3}",
                          dbConnection.State, dbConnection.ServerVersion, dbConnection.ServerThread, dbConnection.Ping()));
			MySqlCommand cmd = dbConnection.CreateCommand();
			cmd.CommandText = "SELECT id,myname FROM mytest.t1";
			MySqlDataReader reader = cmd.ExecuteReader();
			while(reader.Read())
			{
				Debug.Log (string.Format ("ID: {0}, Name: {1}", reader["id"], reader["myname"]));
			}
			reader.Close();
		}
		catch(Exception ex)
		{
			Console.WriteLine(ex.Message);
			Debug.Log(ex.Message);
		}
		finally
		{
			if (dbConnection.State == System.Data.ConnectionState.Open)
	    		dbConnection.Close();
		}
	}
}

You can see the output in the file "output_log.txt" under the folder $MyAppName$_Data in the root folder of your Unity Project.
[28 Jun 2013 22:01] Francisco Alberto Tirado Zavala
Hello.

Are you facing the same issue or you have any additional comment/information about it?

Thanks for your time.
[12 Jul 2013 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".