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

Root user lacks grant privileges #362

Closed
chongma opened this issue Mar 24, 2021 · 3 comments
Closed

Root user lacks grant privileges #362

chongma opened this issue Mar 24, 2021 · 3 comments

Comments

@chongma
Copy link

chongma commented Mar 24, 2021

Somehow the root user has Grant_priv set to N

I have tried putting a file grant.sql containing

GRANT ALL PRIVILEGES on *.* TO 'root'@'%' WITH GRANT OPTION

in the /docker-entrypoint-initdb.d directory but it doesn't have any effect

@grooverdan
Copy link
Member

The entrypoint only has an effect on uninitialized data directories.

Add a init-file configuration option pointing to your grant.sql file.

https://jira.mariadb.org/browse/MDEV-25030

@chongma
Copy link
Author

chongma commented Mar 24, 2021

Thanks. Yes I tried the init-file route without luck. In the end I created a new installation and copied the mysql schema into my old one. i just needed to add back the users manually. Not sure how it got in that state

@chongma chongma closed this as completed Mar 24, 2021
@grooverdan
Copy link
Member

It occurs to me that [docker|podman] run -v entry:/docker-entrypoint-initdb.d -v data:/var/lib/mysql --init-file=/docker-entrypoint-initdb.d/grant.sql may have been simpler.

mysqldump --system=users is a way to get the users and grants with minimal manual work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants