Search Unity

Data Storage on an online MySql-Database

Discussion in 'Multiplayer' started by PalDiaray, Dec 12, 2018.

  1. PalDiaray

    PalDiaray

    Joined:
    Mar 18, 2018
    Posts:
    22
    Hey there,

    i just want to ask if there is a way to store Data from an Unity-App in a MySql-Database without showing the Data through a php-file/www-form. Is it possible to read and write from the database directly over Unity 5? I've read about a net Connector. For me, this function only worked on a local database. But I want to have access to an online database to save/read user data. Any ideas, or some solutions?

    thanks and greetings!
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Why would it only work on a local database? Just use a remote address instead of a local address and configure the database so it accepts clients that aren't local.

    Also, never directly connect an end user application to your database, ever.
     
    Maxim likes this.
  3. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,775
    If you're using a server that connects to the DB that's not a problem. I have a headless unity server that does the DB work. If you're using a client app only, it should never connect directly to a DB, as that's a security risk.

    If your app is a Steam app, they have an API for saving a certain amount of game data.
     
  4. PalDiaray

    PalDiaray

    Joined:
    Mar 18, 2018
    Posts:
    22
    Thanks for your answer. I tried to config a remote access to the database, but i get an error. I'll try a few more things.

    Thanks for your info ;) No it isn't a Steam app. I'll try to make a chat app, where users can chat on a normal webpage and also on the app together. So ill have to save the strings and get them on both devices (mobile and pc). Maybe in the near future also integers, floats and something else. But it won't work for me, if i can't access my database.
    (Info: my database is on a vserver from a other host. I'll connect to the db over my ip on the website).