- Home /
MySQL connector failing to initialize MySqlClient ReplicationManager in Build
I'm getting the following error when trying to interface with a MySQL-capable database:
Rethrow as TypeInitializationException: An exception was thrown by the type initializer for MySql.Data.MySqlClient.Replication.ReplicationManager
at MySql.Data.MySqlClient.MySqlConnection.Open () [0x00000] in <filename unknown>:0
For some reason, the same DLL I'm using in the Editor fails to work in a Standalone build. I've included every DLL that was asked of me by Unity (by copying from the Editor's own set of Mono DLLs). Does anyone know how to get the connection to open without error?
For reference, the DLL for the connector I'm using is version 6.7.9, no install, created October 5 2015, with a SHA256 beginning B30AC09086978. I am using Unity3D version 5.5.0f3.
Answer by VoidStick · May 10, 2017 at 02:13 PM
I've fixed the issue. The resolution is two-fold:
I needed some things that were a part of the full .NET set, so I needed to switch off the .NET Subset
I needed to also include the I18N and I18N.West DLLs to remedy encoding.
After that, everything compiled fine.
This was driving me crazy, thank you! I knew I had all the required dll's copied over, I have connected to SQL Servers and PostgreSQL servers with standalone players - pretty much the same stuff, and have spent about 4 hours looking for the missing piece here.
For completeness, to change the .NET target for your build (as of Unity 5.6): Edit > Project Settings > Player > Other Settings, Configuration, Api Compatibility Level
Your answer
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
Problem with SQLite unity Database 0 Answers
Finish setup php, how to communicate with mySQL and unity 2 Answers
Login from database in unity 0 Answers
Upload audio file into mysql database 0 Answers