1

我在 .net 框架上运行 nhibernate,在测试期间我收到此错误 ERROR 91 0 0 0 发生异常:无法打开连接 NHibernate.ADOException:无法打开连接 ---> NHibernate.ADOException:无法从驱动程序创建连接 - --> MySql.Data.My qlClient.MySqlException: #08004连接太多

in MySql.Data.MySqlClient.PacketReader.CheckForError()
in MySql.Data.MySqlClient.PacketReader.ReadHeader()
in MySql.Data.MySqlClient.PacketReader.OpenPacket()
in MySql.Data.MySqlClient.NativeDriver.Authenticate411()
in MySql.Data.MySqlClient.NativeDriver.Authenticate()
in MySql.Data.MySqlClient.NativeDriver.Open()
in MySql.Data.MySqlClient.Driver.Create(MySqlConnectionString settings)
in MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection()
in MySql.Data.MySqlClient.MySqlPool.GetPooledConnection()
in MySql.Data.MySqlClient.MySqlPool.GetConnection()
in MySql.Data.MySqlClient.MySqlPoolManager.GetConnection(MySqlConnectionString  settings)
in MySql.Data.MySqlClient.MySqlConnection.Open()
in NHibernate.Connection.DriverConnectionProvider.GetConnection()
--- Fine dell'analisi dello stack dell'eccezione interna ---
in NHibernate.Connection.DriverConnectionProvider.GetConnection()
in NHibernate.Impl.SessionFactoryImpl.OpenConnection()
--- Fine dell'analisi dello stack dell'eccezione interna ---
in NHibernate.Impl.SessionFactoryImpl.OpenConnection()
in NHibernate.Impl.SessionImpl.Connect()
in NHibernate.Impl.SessionImpl.get_Connection()
in NHibernate.Transaction.AdoTransaction.Begin(IsolationLevel isolationLevel)
in NHibernate.Transaction.TransactionFactory.BeginTransaction(ISessionImplementor  session, IsolationLevel isolationLevel)
in NHibernate.Transaction.TransactionFactory.BeginTransaction(ISessionImplementor  session)
in NHibernate.Impl.SessionImpl.BeginTransaction()
in interact.VideoSystem.Checks.CheckAviXml() in 
C:\var\projects\videosystem\3.0\VideoServiceSvc\Checks.vb:riga 348
ERROR 91 0 0 0  An exception occurred: cannot open connection
NHibernate.ADOException: cannot open connection ---> NHibernate.ADOException: Could not          create connection from Driver ---> MySql.Data.MyqlClient.MySqlException: #08004Too many connections

in MySql.Data.MySqlClient.PacketReader.CheckForError()
in MySql.Data.MySqlClient.PacketReader.ReadHeader()
in MySql.Data.MySqlClient.PacketReader.OpenPacket()
in MySql.Data.MySqlClient.NativeDriver.Authenticate411()
in MySql.Data.MySqlClient.NativeDriver.Authenticate()..........

我不知道如何解决它!有人能帮我吗' ?提前致谢

4

1 回答 1

0

MySQL 有一个配置设置,它将确定可以创建多少个到服务器的连接。很可能你超过了这个数字。

有关如何解决此问题的更多详细信息,请参阅以下链接:https ://dev.mysql.com/doc/refman/5.5/en/too-many-connections.html。

如果您正在测试并收到此错误,您可能会遇到连接未关闭的问题。因此,我建议您在 MySQL 管理员甚至命令行中进行测试时查看 MySQL 连接,以确定连接是否正在关闭。听起来你正在泄漏连接。

狩猎快乐!

于 2013-01-15T06:18:19.563 回答