在unity 中连接数据库以及查询指定表的内容。
方法一:MySqlDataReader reader = myCommand.ExecuteReader();读取数据
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using MySql.Data.MySqlClient;
public class ConnectDB : MonoBehaviour {
public const string CONNECTIONSTRING = "datasource=127.0.0.1;port=3306;database=roletb;user=root;pwd=root;";
// Use this for initialization