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

Include --no-tablespaces option by default in db-export #260

Closed
yorkshire-pudding opened this issue Jan 10, 2023 · 8 comments · Fixed by #262
Closed

Include --no-tablespaces option by default in db-export #260

yorkshire-pudding opened this issue Jan 10, 2023 · 8 comments · Fixed by #262
Assignees

Comments

@yorkshire-pudding
Copy link
Collaborator

--no-tablespaces is needed in mysqldump for versions of MySQL from 5.7.31 and 8.0.21 unless the user (which will be the backdrop database user) has the PROCESS privilege, which is not available on cPanel based hosting and possibly others.

Therefore, we should include this by default within the db-export command.
It is supported by MariaDB from version 10.2.

We could provide an option to not include this option this if there was a need for it.

(Note, we currently have an option to add this option in via the extra option:

bee db-export --extra="--no-tablespaces" ../db_export.sql

Any thoughts @BWPanda @indigoxela @ElusiveMind @quicksketch @jenlampton @herbdool @klonos
Tagging a number of people who have engaged with the issue queue lately

@herbdool
Copy link
Contributor

I'm not familiar with this at all.

@quicksketch
Copy link
Member

I'm not familiar with this problem, but I found this helpful article that summarizes the situation: https://anothercoffee.net/how-to-fix-the-mysqldump-access-denied-process-privilege-error/

@yorkshire-pudding
Copy link
Collaborator Author

@quicksketch - yes - that's the one I've been looking at. I can't think of any reason not to do this.

@quicksketch
Copy link
Member

As far as my understanding goes, this seems like a safe thing to do as the default. Could we come up with a way to override it, in the event that tablespaces are needed for some situations? Maybe we could do something where if any --extra="" options are passed in at all, none of the default options are automatically applied?

@yorkshire-pudding
Copy link
Collaborator Author

yorkshire-pudding commented Jan 11, 2023

Further checking in the article does suggest that as PROCESS is a server administration privilege, it would not be normal practice to give this to the Backdrop database user, so I do think this is the right default, as hosts using MySQL update to versions where this is required.

According to the MySQL documentation, the PROCESS privilege controls access to information about statements being executed by sessions.

It is a server administration privilege and should not be given to all users. This is because it may show text from currently executing queries. Any user with the PROCESS privilege may therefore see queries issued by others. Here’s the danger: these queries, such as UPDATE user SET password=PASSWORD, may show secrets.

For more information, see General Security Issues and the MySQL Access Privilege System from the O’Reilly MySQL Reference Manual.

I can't find any information that suggests Mariadb needs this privilege (or if so, from what version) and I never encountered it before my host moved to MySQL. Looking in lando for mariadb (10.3 - default), backdrop user is not given Process_priv

@yorkshire-pudding yorkshire-pudding added the pr: needs testing A pull request has been linked to the issue and requires testing. label Jan 11, 2023
@yorkshire-pudding
Copy link
Collaborator Author

PR added if anyone wants to test. If not, I'll merge.

@yorkshire-pudding yorkshire-pudding self-assigned this Jan 11, 2023
@indigoxela
Copy link
Member

Sorry, not a big help here, as I have MariaDB in all testing environments. The only thing I can test: things still work fine with MariaDB (but they also do without patch).

@yorkshire-pudding
Copy link
Collaborator Author

Not breaking MariaDb is a good result!

@yorkshire-pudding yorkshire-pudding removed the pr: needs testing A pull request has been linked to the issue and requires testing. label Jan 30, 2023
yorkshire-pudding added a commit to yorkshire-pudding/bee that referenced this issue Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants