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

*: provide a command line flag --skip-grant-table #2897

Merged
merged 4 commits into from
Mar 21, 2017

Conversation

tiancaiamao
Copy link
Contributor

This flag is useful when user forget root password.
A powerful and dangerous flag.

dropDBSQL := fmt.Sprintf("drop database %s;", dbName)

save1 := privileges.Enable
save2 := privileges.SkipWithGrant
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

defer privileges.Enable = save1, privileges.Enable = save1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

defer can't apply to a expression, it need to use a function.
here is a really simple case, defer seems overkill.

@shenli
Copy link
Member

shenli commented Mar 20, 2017

MySQL only allow root user to skip authentication.

@tiancaiamao
Copy link
Contributor Author

I checked that the user have root privilege. @shenli

@coocood
Copy link
Member

coocood commented Mar 21, 2017

LGTM

@zimulala zimulala added the status/LGT1 Indicates that a PR has LGTM 1. label Mar 21, 2017
Copy link
Member

@hanfei1991 hanfei1991 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hanfei1991 hanfei1991 removed the status/LGT1 Indicates that a PR has LGTM 1. label Mar 21, 2017
@tiancaiamao tiancaiamao merged commit 13fa294 into master Mar 21, 2017
@tiancaiamao tiancaiamao deleted the tiancaiamao/skip-grant-table branch March 21, 2017 10:16
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

Successfully merging this pull request may close these issues.

5 participants