简体   繁体   中英

mysql with nhibernate too many connections

i'm runnning nhibernate on .net framework, during testing I receive this error 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.My qlClient.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()
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()..........

I do not have idea how to solve it ! can someone help me' ? thanks in advance

MySQL has a configuration setting that will determine how many connections can be created to the server. Most probably you ran over this number.

See the following link: https://dev.mysql.com/doc/refman/5.5/en/too-many-connections.html for more details on how to resolve this.

If you are testing and receiving this error you might be facing a problem that connections are not closing. So I would suggest you look at the MySQL connections when testing in the MySQL administrator or even command line to determine if connections are being closed. Sounds like you are leaking connections.

Happy Hunting!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM