在 unity 上使用 c# 访问 MySQL 数据库? [英] Accessing MySQL database using c# on unity?
问题描述
我刚刚开始使用 C#,对它了解不多.我正在使用名为 Unity 的 3d 游戏引擎并尝试编写一个 c# 脚本来访问我正在运行的 MySQL 数据库.MySQL 数据库位于另一台计算机上.我的问题是如何使用 C# 访问 MySQL 数据库.我知道我想使用的用户名、密码和数据库,但我不知道如何访问数据库.
I have just started using C# and do not know much about it. I am using the 3d game engine called Unity and trying to write a c# script to access the MySQL database that I am running. The MySQL database is on a different computer. My question is how can I access the MySQL database using C#. I know the username, password and database I want to use, but I can not figure out how to access the database.
推荐答案
您需要获取 C# MySQL 驱动程序:http://dev.mysql.com/downloads/connector/net/
You will need to get the C# MySQL driver: http://dev.mysql.com/downloads/connector/net/
然后您需要按照 MySQL 手册进行设置和使用.它是一个标准的 ADO.NET 驱动程序,因此您应该能够按照大多数 C# SQL 教程获得更多帮助.
And then you will need to follow the MySQL manual for setting it up and using it. It's a standard ADO.NET driver, so you should be able to follow most any C# SQL tutorials out there for additional help.
这篇关于在 unity 上使用 c# 访问 MySQL 数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!