User root already has more than 'max_user_connections' active connections in Hibernate

前端 未结 1 2002
闹比i
闹比i 2021-01-28 08:52

i am using JDBC and Hibernate for Connecting to database.

so i am firing select Query to database using JDBC, but when i fire insert Query using Hibernate it gives an ex

相关标签:
1条回答
  • 2021-01-28 09:29

    You have exhausted the number of connections you have configured in you DB for root. I am guessing you are using MySQL (just a hunch based on the userid). There are several fixes you can try:

    1. Create more than one user for all your apps so that you are not competing for connections to the DB
    2. Increase the number of connections allowed by your userid, which appears to be root
    3. Decrease the number of connections your apps are using. Hopefully you are using a connection pool.

    You probably need to check your code to make sure you are closing connections appropriately. Your code could be orphaning connections over time.

    It would be important to note that outside of a dev environment, you really should not be doing any app coding as root. The root user has too many privileges, and you open yourself to all sorts of nasty problems from a security aspect.

    0 讨论(0)
提交回复
热议问题