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

cnf priority #97

Open
organisciak opened this issue Apr 6, 2016 · 1 comment
Open

cnf priority #97

organisciak opened this issue Apr 6, 2016 · 1 comment

Comments

@organisciak
Copy link
Member

I made some config changes (i.e. adding os.path.expanduser to home paths), only to git pull and see that they were already done! That's why you pull to start. I have one discussion topic though, regarding the priority order.

Currently, the order is 1) local user locations (~/.my.cnf), then 2) global mysql locations (/etc/mysql/my.cnf), then finally 3) a local directory file that can overwrite everything. It seems to me that the sensible order would be to reverse (1) and (2), and add /etc/bookworm/my.cnf right before (3).

This is what I would suggest, which is global general cnf, local general cnf, global bookworm-specific cnf, local bookworm-specific cnf:

["/etc/mysql/my.cnf","/etc/my.cnf","/root/.my.cnf", "/.my.cnf",os.path.expanduser("~/my.cnf"),os.path.expanduser("~/.my.cnf"),"/etc/bookworm/my.cnf", "bookworm.cnf"]
@bmschmidt
Copy link
Member

Which code line are we talking about? This is unfortunately still being handled in a couple places.

In general, I'm trying to sketch out the preferred order here, which is a longer list than this one: just 'global general cnf', for example, comes out at:

"/usr/etc/my.cnf","/etc/mysql/my.cnf","/etc/my.cnf","/etc/mysql/conf.d/mysql.cnf","/etc/bookworm/my.cnf"]

The order of this list has to depend on what privileges the server is requesting. So a query should ask for read-only permissions first and then fall back to an account that allows it to write; while a creation scheme script should ask for administrative user first, fall back to a root user, and finally fall back to a read-only account (b/c there still might be something they can do).

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