[英]Access denied for user 'user' error while trying to connect to online DB
I saw couple of other posts here with the same title, and tried to follow their solutions but no help..我在这里看到了一些具有相同标题的其他帖子,并尝试遵循他们的解决方案,但没有帮助。
I am trying to connect unity3d 5 to a online database.我正在尝试将 unity3d 5 连接到在线数据库。 but I keep getting this error
但我不断收到此错误
MySqlException: Access denied for user 'altjenb'@'217.73.137.52' (using password: YES) MySql.Data.MySqlClient.MySqlStream.ReadPacket ()
MySqlException: 用户 'altjenb'@'217.73.137.52' 的访问被拒绝(使用密码:YES)MySql.Data.MySqlClient.MySqlStream.ReadPacket ()
MySql.Data.MySqlClient.NativeDriver.AuthenticateNew () MySql.Data.MySqlClient.NativeDriver.Authenticate () MySql.Data.MySqlClient.NativeDriver.Open () MySql.Data.MySqlClient.Driver.Open () MySql.Data.MySqlClient.Driver.Create (MySql.Data.MySqlClient.MySqlConnectionStringBuilder settings) MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection () MySql.Data.MySqlClient.MySqlPool.GetPooledConnection () MySql.Data.MySqlClient.MySqlPool.TryToGetDriver () UnityEngine.EventSystems.EventSystem:Update()
MySql.Data.MySqlClient.NativeDriver.AuthenticateNew() MySql.Data.MySqlClient.NativeDriver.Authenticate() MySql.Data.MySqlClient.NativeDriver.Open() MySql.Data.MySqlClient.Driver.Open() MySql.Data.MySqlClient。 Driver.Create(MySql.Data.MySqlClient.MySqlConnectionStringBuilder 设置) MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection() MySql.Data.MySqlClient.MySqlPool.GetPooledConnection() MySql.Data.MySqlClient.MySqlPool.TryToGetDriver() UnityEngine.EventSystems。事件系统:更新()
this is my source code in C#:这是我在 C# 中的源代码:
MySqlConnection connectionstring = new MySqlConnection("Server=mysql8.db4free.net; Port=3306;Database=testdb;UserId= altjenb; Password = faeefg; ");
string cmdText = "SELECT 1 FROM Login WHERE Username = awd";
using (MySqlCommand SelectCommand = new MySqlCommand(cmdText, connectionstring)) {
MySqlDataReader myReader;
connectionstring.Open();
myReader = SelectCommand.ExecuteReader();
int count = 0;
while (myReader.Read())
{
count = count + 1;
}
if (count == 0)
{
Debug.LogWarning("spunon");
}
else {
Debug.LogWarning("punon");
}
}
why do I keep getting this?为什么我一直收到这个? I dont understand..
我不明白..
EDIT: after getting a tweet from the db4free, they suggested to change the port from 3306 to 3307. but still getting an error.编辑:从 db4free 收到一条推文后,他们建议将端口从 3306 更改为 3307。但仍然出现错误。
KeyNotFoundException: The given key was not present in the dictionary.
KeyNotFoundException: 字典中不存在给定的键。 System.Collections.Generic.Dictionary`2[System.String,MySql.Data.MySqlClient.CharacterSet].get_Item (System.String key) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:150)
System.Collections.Generic.Dictionary`2[System.String,MySql.Data.MySqlClient.CharacterSet].get_Item(System.String 键)(在 /Users/builduser/buildslave/mono/build/mcs/class/corlib/System .Collections.Generic/Dictionary.cs:150)
try to change from mysql8.db4free.net to db4free.net and the port 3306. same user details.尝试从 mysql8.db4free.net 更改为 db4free.net 和端口 3306。相同的用户详细信息。 it should work
它应该工作
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.