Dienstag, 15. September 2015

C# - Mono with MySql Connector under Linux



  • I assume you already installed the mono runtime.
  • Your logged in on your Linux machine.
  • You did open a terminal.

  1. Download the .NET/mono assembly, provided by oracle.com.
    http://lmgtfy.com/?q=c%23+mysql+connector
  2. Unzip the files.
  3. Enter the v2.0 folder.
  4. Open a terminal.
    I'm not sure what the different versions are. When you know it, fell free to leave a comment.
  5. Now you add the "MySql.Data.dll" assembly to the runtime assemblies.
    sudo gacutils -i MySql.Data.dll
That's it usually. Well, i had some permission trouble. You might go to the directory /urs/lib/mono/gac/MySql.Data/ and look in the subfolder for your added assembly MySql.Data.dll. Here you might type ls -l to show your permission on the file. Type chmod +rx MySql.Data.dll. With this you granted yourself and all other users of your computer the permission to read the file and execute it.

Make sure to add the references System and System.Data to your project.