mysql-con,的MySqlConnection =新的MySqlConnection(串)不工作(MySqlCon

这是我在Visual Studio中连接到Unity3d代码:

public void SetupSQLConnection()

{

Debug.Log("Connection Function Started");

if (connection == null)

{

Debug.Log("If connection == null");

try

{

Debug.Log("Try block started");

string connectionString = "Server=localhost;" + "Database=therapygame;" + "UID=root;" + "Password=;";

Debug.Log("string set");

connection = new MySqlConnection(connectionString);

Debug.Log("new MySqlConnection");

connection.Open();

Debug.Log("connection");

}

catch (MySqlException ex)

{

Debug.LogError("MySQL Error: " + ex.ToString());

}

}

}

控制台琴弦印刷一路“串集”,但随后的其余不打印。

这里是统一的错误:

KeyNotFoundException:给定的关键是不存在的字典。 System.Collections.Generic.Dictionary`2 [System.String,System.Object的] .get_Item(System.String键)(在/Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic /Dictionary.cs:150)MySql.Data.MySqlClient.MySqlConnectionStringBuilder.get_Database()MySql.Data.MySqlClient.MySqlConnection.set_ConnectionString(System.String值)MySql.Data.MySqlClient.MySqlConnection..ctor(System.String的connectionString)(包装远程-调用与 - 检查)MySql.Data.MySqlClient.MySqlConnection:.ctor(字符串)mysql.SetupSQLConnection()(在资产/ mysql.cs:31)fire_rate.Start()(在资产/ fire_rate.cs: 18)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值