Use a database user that is not root or DBA on MySQL
Try to create a new tenant.
Expected behavior
Tenant is created and user has the same permissions on the new database as he/she had on the public database.
Actual behavior
Tenant is created, but user has only the select grant given to him on the new database.
System configuration
Database: MySQL 5.7
Apartment version: Newest
Apartment config: Only some excluded_subdomains.
use_schemas: true
Rails (or ActiveRecord) version: 5.2.0
Ruby version: 2.5.1
** Additional info
I provided a work-around for this creating a CustomElevator that prepends the tenant name with a string. Then, I give the grants needed to my user on MySQL based on a wildcard (string_%) which works fine as a work-around.
I would like to bring to discussion the following ideas:
Which are the minimum grants needed for the database user to use apartment?
Can the code that creates the tenants include the SQL statements for providing the permissions needed on the newly created database?
Is there a better approach for solving this issue than the one I came up with?
Thanks for the amazing gem and sorry if my English is not clear enough.
Steps to reproduce
Expected behavior
Actual behavior
System configuration
Database: MySQL 5.7
Apartment version: Newest
Apartment config: Only some excluded_subdomains.
use_schemas
:true
Rails (or ActiveRecord) version: 5.2.0
Ruby version: 2.5.1
** Additional info
I provided a work-around for this creating a CustomElevator that prepends the tenant name with a string. Then, I give the grants needed to my user on MySQL based on a wildcard (
string_%
) which works fine as a work-around.I would like to bring to discussion the following ideas:
Thanks for the amazing gem and sorry if my English is not clear enough.
Bests,