- Home /
MySql compiler error help~ (OSX)
Hi guys,
I'm trying to setup mysql database access via c# on OSX, and thus far getting stuck on compiler errors. Files I've added thus far to my project folder are: - MySql.Data.dll - System.Drawing.dll - I18N.dll - I18N.West.dll
The compiler error (first few lines): Unhandled Exception: System.TypeLoadException: Could not load type 'System.Threading.Tasks.Task`1' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
I'm new to databases, so with regards to the mysql connector, i downloaded the zip, and just grabbed the MySql.Data.dll file and placed it into my project folder. couldn't figure out what to do with all the rest of the files...
Any help would be greatly appreciated!! Thanks!!
Answer by Spidlee · Dec 27, 2014 at 06:03 AM
Update: decided to go with accessing the database via the php layer instead. (supposed to be safer for security reasons, and well... i couldn't figure out how to get past the compiler errors lol..) here's a good reference: http://wiki.unity3d.com/index.php?title=Server_Side_Highscores
I have this error also. Unlike the OP, I do not want to use a PHP layer, for several reasons:
The security of $$anonymous$$ySQL connectivity is not applicable here, because my app will run only on an isolated, trusted network, and because the $$anonymous$$ySQL connections will be done only by a dedicated server on the same physical host using UNIX sockets, not TCP. I'm building an intranet app, not an online $$anonymous$$$$anonymous$$O.
Although Unity newbies (like me) are often advised to deploy a PHP layer for security, PHP is not magically secure. Unless you know what you're doing, PHP wrappers can be very vulnerable to SQL injection attacks and other vulnerabilities. I'm new to Unity, but I've programmed PHP for well over a decade.
A PHP layer and HTTP request/response overhead will perform poorly compared to native SQL socket connections when looping back to the same host.
I don't want to have to deal with Apache (or equivalent) plus PHP on the dedicated host just to run a wrapper. Yes, I know how to configure them, but I don't need or want the overhead.
I'd appreciate any advice here on how to work around this problem. The error message doesn't say what DLL or script was at fault here; I finally found this match with a Google search, and verified that the errors disappear if I remove the $$anonymous$$ySQL DLLs (and code using them) from my test project.
Has anyone solved this before, and if so, which versions of which DLLs are you using? A pointer to an online source would be very helpful. I've spent a lot of time searching, and I keep hitting the same advice to just use PHP but no real answer to the original question.
Thanks for any suggestions, URL pointers, or advice.