Search Unity

MySQL connection in Unity C#. Please help!

Discussion in 'Scripting' started by Red_Kay, Aug 10, 2016.

  1. Red_Kay

    Red_Kay

    Joined:
    Aug 14, 2015
    Posts:
    94
    Yo!

    So, I have a MySQL server on an Amazon EC2 Instance, I just wanted to know:

    QUESTION : Is there any way of connecting to MySQL server in Untiy C#? If yes then if you can guide me through it that will be great! I searched a bit on google but didn't got much.

    Thanks for your time! :)
     
  2. Dave-Carlile

    Dave-Carlile

    Joined:
    Sep 16, 2012
    Posts:
    967
    1. Unity itself doesn't have any interface for this. You would just use a normal C# MySQL library to do it and there should be plenty of information from Google for that.
    2. Generally you wouldn't want to connect directly to the database from your game client. This would expose whatever database credentials are require for connecting, among other security and performance issues. This sort of thing should go through a web service or a game server of some sort.