Bookworm-project / BookwormDB

Tools for text tokenization and encoding
MIT License
84 stars 12 forks source link

cnf priority #97

Open organisciak opened 8 years ago

organisciak commented 8 years ago

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 commented 8 years ago

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).