- Home /
How to fix MySQL Connection error?
Hey, Im using MySQL .NET Connector to connect me to my database in my game's server. I just tried to build the server and the DB connection does not work in the build. Yes i have included System.Data, I18N and I18NWest and still getting the error. This is my function
public static void Initialize () {
server = "127.0.0.1";
database = "Derp";
uid = "Herp";
mySQLpassword = "Hurrdurr";
string connectionString =
"SERVER=" + server + ";" +
"DATABASE=" + database + ";" +
"PORT=" + "8889" + ";" +
"UID=" + uid + ";" +
"PASSWORD=" + mySQLpassword + ";";
connection = new MySqlConnection(connectionString);
connection.Open();
initialized = true;
}
After running the build and reading the log this is the error that comes up.
Exception: INTERNAL configuration error: failed to get configuration 'system.diagnostics'
at System.Diagnostics.DiagnosticsConfiguration.get_Settings () [0x00000] in <filename unknown>:0
at System.Diagnostics.TraceSource..ctor (System.String name, SourceLevels sourceLevels) [0x00000] in <filename unknown>:0
at System.Diagnostics.TraceSource..ctor (System.String name) [0x00000] in <filename unknown>:0
at MySql.Data.MySqlClient.MySqlTrace..cctor () [0x00000] in <filename unknown>:0
Rethrow as TypeInitializationException: An exception was thrown by the type initializer for MySql.Data.MySqlClient.MySqlTrace
at MySql.Data.MySqlClient.Driver.Create (MySql.Data.MySqlClient.MySqlConnectionStringBuilder settings) [0x00000] in <filename unknown>:0
Thanks for your help :) Is there anything I can do?
And yes, I have the MySQL DLL, you can see in the error log.
Have you added the $$anonymous$$ySQL dll to your project? I´ve never tried this with Unity but I remember using it for web development.
bug fixed. download driver source from http://dev.mysql.com/downloads/connector/net/1.0.html#downloads (i use 6.0.7) open in monodev and build. work on mac.
Your answer
Follow this Question
Related Questions
MySql On Web ? 1 Answer
Connecting to access database via C# 1 Answer
Web Player and database 1 Answer
possible to get secure mysql connection while database is from a hoster? 0 Answers
WWW Form, MySQL, Azure Question 1 Answer