I have just started using C# and do not know much about it. I am using the 3d game engine called Unity and trying to write a c# script to access the MySQL database that I am
Unity3D uses stripped Mono.net which doesn't support database directly. You can write your own DLL in C# .NET which does data access for you. Then add it in your Unity3D project.
While you are writing your own DLL, make sure when you bring that DLL to your project, you also copy referenced DLL in the same folder. Best approach would be to use Mono.NET.