我在.net框架上运行nhibernate,在测试期间我收到此错误 ERROR 91 0 0 0发生异常:无法打开连接 NHibernate.ADOException:无法打开连接---> NHibernate.ADOException:无法从Driver --->创建连接MySql.Data.My qlClient.MySqlException:#08004Too许多连接
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()..........
我不知道如何解决它! 有人能帮我吗' ? 提前谢谢
答案 0 :(得分:0)
MySQL有一个配置设置,用于确定可以为服务器创建多少个连接。很可能你跑过这个号码。
有关如何解决此问题的详细信息,请参阅以下链接:https://dev.mysql.com/doc/refman/5.5/en/too-many-connections.html。
如果您正在测试并收到此错误,则可能会遇到连接未关闭的问题。因此,我建议您在MySQL管理员甚至命令行中进行测试时查看MySQL连接,以确定是否正在关闭连接。听起来你正在泄漏关系。
快乐狩猎!