Skip to content

MysqlPermissions

Chris Delis edited this page Oct 15, 2015 · 1 revision

What Kind of Permissions Does the MySQL User Require?

root. Yes, root. If you do not wish to use the root user, you will need to make your non-root user have permissions to create and drop databases, functions, and procedures. We understand this is a little different from the norm, but the MST is not your typical application either.

Why root?

The MST creates new databases for each repository (harvest/service). These databases contain common tables (records, records_xml, etc.). For services, they can also contain other custom tables. Giving each service its own database simplifies things for the service implementer, as each service is defaulted to using its own database and does not need to worry about name collisions. Alternatively, instead of giving each repository its own database, we could use table name prefixes (eg marcnormalization_records, marcnormalization_records_xml, etc.) to distinguish between repositories and keep all the MST data in one database. However, this makes it more difficult for service implementers not to bump into each other (or provide an environment which restricts them from doing so). That is the reason why the MST creates databases on the fly and requires a MySQL user with permissions to do so.

"But this is against our policy."

Consider the MySQL server used by the MST to be part of the MST application. In other words, the MySQL server used by the MST has only MST data on it and is run on the same machine as the MST. It has not been in our design to have the MST’s MySQL data hosted on some other machine. It is possible that we could tailor to this in a future release if need be, but that is not the way it is expected to work as of now. If you do not want to give the MST root access because other applications share the same database, you might consider installing another MySQL instance on that machine.

"But databases are being created that I know nothing about."

We understand db admins like to have control over database tables, schemas, users, etc., which is why we suggest viewing the MST’s database as part of the MST application. If you are concerned that the MST might not play nicely with other databases sharing the same MySQL instance, then you can sandbox it by giving it its own instance. That is the nature of the MST. We are providing a toolkit and platform for services of which we know nothing to be researched and written about. To provide this kind of flexibility, you must give up some control. We are open to hearing any other suggestions to accomplish this goal.

Clone this wiki locally