gpt4 book ai didi

c# - 系统启动时通过 .net 连接器连接 mysql 时出错

转载 作者:太空宇宙 更新时间:2023-11-04 13:03:09 25 4
gpt4 key购买 nike

出现以下错误

MySql.Data.MySqlClient.MySqlException (0x80004005): Unable to connect to any of the specified MySQL hosts. ---> System.Net.Sockets.SocketException (0x80004005): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 111.22.3.44:3306
at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
at MySql.Data.Common.MyNetworkStream.CreateSocketStream(MySqlConnectionStringBuilder settings, IPAddress ip, Boolean unix)
at MySql.Data.Common.MyNetworkStream.CreateStream(MySqlConnectionStringBuilder settings, Boolean unix)
at MySql.Data.Common.StreamCreator.GetTcpStream(MySqlConnectionStringBuilder settings)
at MySql.Data.MySqlClient.NativeDriver.Open()
at MySql.Data.MySqlClient.NativeDriver.Open()
at MySql.Data.MySqlClient.Driver.Open()
at MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings)
at MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection()
at MySql.Data.MySqlClient.MySqlPool.GetPooledConnection()
at MySql.Data.MySqlClient.MySqlPool.TryToGetDriver()
at MySql.Data.MySqlClient.MySqlPool.GetConnection()
at MySql.Data.MySqlClient.MySqlConnection.Open()
at CC.DataAccess.ConnectionManager.GetConnection()

我的数据库服务器在 Centos 上,版本为 5.6.25我正在使用 .net 4.5 和 mysqlconnecot 6.9.7。有没有其他人遇到过这个问题

最佳答案

你的代码兄弟在哪里?你能在这里粘贴你的示例代码吗?

你可能会得到一些提示:

Unable to connect to MySQL database from ASP.NET

Unable to connect to any of the specified mysql hosts. C# MySQL

关于c# - 系统启动时通过 .net 连接器连接 mysql 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33384516/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com