Skip to content

Support max_user_connections in database_user #215

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

Merged
merged 4 commits into from
Jul 10, 2013
Merged

Support max_user_connections in database_user #215

merged 4 commits into from
Jul 10, 2013

Conversation

mbakke
Copy link

@mbakke mbakke commented Jul 8, 2013

Here's code to support max_user_connections on the account level.

This is my first venture into rspec, so I can't promise that the tests are any good.

Unfortunately it cannot be added during user creation without changing CREATE USER to a GRANT statement. I can do this if desirable.

@apenney
Copy link
Contributor

apenney commented Jul 9, 2013

I think I'd be interested in hearing about the switch to a GRANT for creating the user. (Or even seeing an example of what that would look like). I would love it if this worked as part of the initial create so changing whatever you would need to sounds good to me assuming it would give the same result if they weren't setting max_user_connections at all.

@mbakke
Copy link
Author

mbakke commented Jul 10, 2013

I've changed user creation to a GRANT that always passes max_user_connections (0 if not part of the resource).

Note that this will require a password hash if the NO_AUTO_CREATE_USER SQL mode is activated. I assume the ones running that mode already knows this, but perhaps it should be documented.

http://dev.mysql.com/doc/refman/5.6/en/grant.html

@apenney
Copy link
Contributor

apenney commented Jul 10, 2013

I think this looks great! Thank you for putting in the time and effort on this. :)

apenney added a commit that referenced this pull request Jul 10, 2013
Support max_user_connections in database_user
@apenney apenney merged commit 1bd970d into puppetlabs:master Jul 10, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants