Hi, @Yatego! When I tried make the LoginGUI.cs script I got an error- Assets/Scripts/LoginGUI.cs(8,9): error CS0246: The type or namespace name `DatabaseHandler' could not be found. Are you missing an assembly reference?
It's very dangerous to give complete host info to Unity without taking info from a web page. Because C# is very ez to decompile and everyone can get host info from it. And think that you are doing this game for android. Easier to decompile…
The type or namespace name `MySQLConnection' could not be found. Are you missing a using directive or an assembly reference? Solution 'My Game' (loading…) Assets/Scripts/DatabaseHandler.cs 34
Type `MySql.Data.MySqlClient.MySqlConnection' does not contain a definition for `state' and no extension method `state' of type `MySql.Data.MySqlClient.MySqlConnection' could be found (are you missing a using directive or an assembly reference?) Solution 'My Game' (loading…) Assets/Scripts/DatabaseHandler.cs 53
I'm sure it's a good tutorial, but if somebody where to decompile your game (.net games are easy to decompile) Your database info would be available for everybody to see. This is very bad security wise (obviously), I'd suggest having a PHP script on your website and preparing sql statements to prevent sql injection, and use a WWWForum instead to send data to your webserver.
1.- using System.Data; says "Uknown resolve error" 2.- con.Dispose (); say "MySql.Data.MySqlClient.MySqlConnection does not not contain a definition for 'Dispose' " 3.- con.State.ToString() … ToString() its marked red. 4.- On LoginGUI this line public DatabaseHandler _mysqlHolder; says DatabaseHandler does not exist on the current context.
You can't do ANY of this…Your game CLIENT is making a direct connection to your database which shouldn't even be accessible. You're storing your entire connection string in the client executable, which means you're performing all of your authoritative logic on the client as well.
help. This tutorial does not work. I made all like in tutorial but in error log i see "NullReferenceException: Object reference not set to an instance of an object DatabaseHandler.GetConnectionState () (at Assets/scripts/DatabaseHandler.cs:52) LoginGUI.OnGUI () (at Assets/scripts/LoginGUI.cs:9)"
I'm trying to labeling con.ToString() but it null. What i do wrong?
26 responses to “[Unity] MMO Tutorial #001 – MySQL Connection”
Download link does not work!!!
Hi, @Yatego! When I tried make the LoginGUI.cs script I got an error-
Assets/Scripts/LoginGUI.cs(8,9): error CS0246: The type or namespace name `DatabaseHandler' could not be found. Are you missing an assembly reference?
Do I need to reference another dll?
I am trying to connect to my web hosting but it gives me an error, which can be??
make another link and can be a .exe file injected ?
Thank you very much.
It helped me a lot!
Thanks
Can't get con.State.ToString()
Can i do this on mac?
It's very dangerous to give complete host info to Unity without taking info from a web page. Because C# is very ez to decompile and everyone can get host info from it. And think that you are doing this game for android. Easier to decompile…
The type or namespace name `MySQLConnection' could not be found. Are you missing a using directive or an assembly reference? Solution 'My Game' (loading…) Assets/Scripts/DatabaseHandler.cs 34
Type `MySql.Data.MySqlClient.MySqlConnection' does not contain a definition for `state' and no extension method `state' of type `MySql.Data.MySqlClient.MySqlConnection' could be found (are you missing a using directive or an assembly reference?) Solution 'My Game' (loading…) Assets/Scripts/DatabaseHandler.cs 53
Any help fixing??
Your English is great thanks for the MySql lesson.
Hello, can you re-upload the package using another server? I'm really can't download it. I don't know the link is broken or the file was deleted
I'm sure it's a good tutorial, but if somebody where to decompile your game (.net games are easy to decompile) Your database info would be available for everybody to see. This is very bad security wise (obviously), I'd suggest having a PHP script on your website and preparing sql statements to prevent sql injection, and use a WWWForum instead to send data to your webserver.
Download link does not work!!!
Hi, I got a problem:
1.- using System.Data; says "Uknown resolve error"
2.- con.Dispose (); say "MySql.Data.MySqlClient.MySqlConnection does not not contain a definition for 'Dispose' "
3.- con.State.ToString() … ToString() its marked red.
4.- On LoginGUI this line public DatabaseHandler _mysqlHolder; says DatabaseHandler does not exist on the current context.
The download link is not working for me.Can you please share a link of googledrive/dropbox please ?
Thank you
I need to do something similar but with T-SQL for a school project, any pointers? 🙂
Are you dying?
Does it works on free Unity 5 version? i means, need i Unity Pro?
You can't do ANY of this…Your game CLIENT is making a direct connection to your database which shouldn't even be accessible. You're storing your entire connection string in the client executable, which means you're performing all of your authoritative logic on the client as well.
You need to go back to the drawing board.
??????????????????????????????????????????????????
using MySql.Data; doesnt exist
Thank you so much for this great tutorial.
Letzebuuuerg? 😉
help. This tutorial does not work. I made all like in tutorial but in error log i see
"NullReferenceException: Object reference not set to an instance of an object
DatabaseHandler.GetConnectionState () (at Assets/scripts/DatabaseHandler.cs:52)
LoginGUI.OnGUI () (at Assets/scripts/LoginGUI.cs:9)"
I'm trying to labeling con.ToString() but it null. What i do wrong?
Thanks, good tut.
The links in the description are installing adware.
This is an awesome tutorial