Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impossible to run tests with a MAX_USER_CONNECTIONS option on MySQL #22556

Closed
nesk opened this issue Dec 28, 2017 · 2 comments
Closed

Impossible to run tests with a MAX_USER_CONNECTIONS option on MySQL #22556

nesk opened this issue Dec 28, 2017 · 2 comments

Comments

@nesk
Copy link
Contributor

nesk commented Dec 28, 2017

  • Laravel Version: 5.5.28
  • PHP Version: 7.1.12
  • Database Driver & Version: MySQL 5.7.20

Description:

If you're running some tests involving a MySQL database with a low value for the MAX_USER_CONNECTIONS option, then you will encounter the following exception:

PDOException: SQLSTATE[HY000] [1226] User 'max_connections_user' has exceeded the 'max_user_connections' resource (current value: 5)

For example, if you have 10 database tests and a connection limit set to 5, then the 6th test (and the next ones) will fail with the exception above. It seems like Laravel isn't properly closing the previous connections, or not in time.

Steps To Reproduce:

CREATE DATABASE max_connections_db;

CREATE USER 'max_connections_user'@'localhost' WITH MAX_USER_CONNECTIONS 5;

GRANT ALL PRIVILEGES ON * . * TO 'max_connections_user'@'localhost';
  • Run the tests with phpunit, you should see the following exception:
PDOException: SQLSTATE[HY000] [1226] User 'max_connections_user' has exceeded the 'max_user_connections' resource (current value: 5)
@sisve
Copy link
Contributor

sisve commented Dec 28, 2017

This seems related to #18471

@nesk
Copy link
Contributor Author

nesk commented Dec 29, 2017

You're right, I'm closing the issue.

@nesk nesk closed this as completed Dec 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants