I have Spring boot apllication and unit tests.
I build it with Travis-CI but while running unit tests i got:
Caused by: org.hibernate.HibernateException: com.zaxxer.hikari.pool.PoolInitializationException: Exception during pool initialization
Caused by: com.zaxxer.hikari.pool.PoolInitializationException: Exception during pool initialization
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Data source rejected establishment of connection, message from server: “Too many connections”
I use mysql and i added these commands in .travis.yml file to increase maximum connection:
- echo -e "[server]\nmax_connections=2000\ninnodb_log_file_size=256MB\ninnodb_buffer_pool_size=512MB\nmax_allowed_packet=16MB" | sudo tee -a /etc/mysql/my.cnf
I run this command and i can display maximum connection number increased to 2000:
- mysql -u root -e "SHOW VARIABLES where Variable_name = 'max_connections';"
But still i got “too many connection error”
How can i solve it? Thank you
Here is my yml file: