- Home /
Using MySQL with browser games
I have two questions related to using MySQL with a browser-deployed Unity game:
1) Is it safe to directly use the MySQL connector in the game code? I know that this is normally dangerous, as there are methods for uncovering the database username/password. However, in the case of a browser game, would all such communication happen server-side, negating the security risk?
2) If you do directly use the MySQL connector in a browser-only game, would you be subject to MySQL's commercial license fee? My understanding is that you are only subject to the license if you are distributing the connector. I'm curious if a browser-based game would be considered distribution in this sense.
I understand any answers can't be taken as legal advice :) I would definitely verify with a MySQL rep before embarking on a commercial endeavor.
1) afaik, no. I would still recommend having a caller to an external script with your sql_connect and sql_close functions. Anyway, better safe than sorry yeah?
2) I'd assume if it's a commercial game, you would be subject to commercial liscensing. But for any form of re-assurance, I suggest you contact $$anonymous$$ySQL's Support at: http://www.mysql.com/about/contact/
I'm pretty sure that just because a game is commercial does not alone make it subject to $$anonymous$$ySQL's commercial licensing. Otherwise most websites making use of a $$anonymous$$ySQL database would be subject.
Answer by Dreamora · Jun 13, 2010 at 12:44 AM
1) Unity is never executed on the server, always the clients machine. As such you would require a wildcard account to the DB, which is a serious security threat.
2) First you have to find one that works with .NET cause normally the binding is in relation to the mysql dynamic unmanaged libraries (dll / so), which can not be used in the webplayer at all. Once you found that, check its license and consequences.
Use PHP / ASP / CGI as a communication inbetween and WWW requests to get your data.
Thanks for the great info! Quick follow-up question: Do you know if the transmission of WWW requests to a PHP page is visible to the user (via packet sniffing or other methods)? If so, I imagine this data would need to be encrypted or transmitted via some sort of secure connection?
Your answer
Follow this Question
Related Questions
Unity to PHP/MySQL: password and username security 1 Answer
How do I build a gateway to communicate between the game client and mySQL server? 1 Answer
Authoritative Server With MySQL 1 Answer
Call to PHP security (transmission security)? 0 Answers
Unity Member subscription game More security? IDEAS? 0 Answers