Create or replace view `members_resolved_subscription` as - ER_TABLEACCESS_DENIED_ERROR

Hi guys.

I’m trying go upgrade/migrate - something which worked for me in the past - my ghost but I fail with:

create or replace view `members_resolved_subscription` as
        SELECT member_id, subscription_id
        FROM (
            SELECT
                msc.member_id,
                mscs.id as subscription_id,
                ROW_NUMBER() OVER (
                    PARTITION BY msc.member_id
                    ORDER BY
                        CASE WHEN mscs.status IN ('active', 'trialing', 'past_due', 'unpaid') THEN 0 ELSE 1 END,
                        mscs.created_at DESC,
                        mscs.id ASC
                ) as rn
            FROM members_stripe_customers_subscriptions mscs
            JOIN members_stripe_customers msc ON msc.customer_id = mscs.customer_id
            WHERE mscs.status NOT IN ('incomplete', 'incomplete_expired')
        ) ranked
        WHERE rn = 1
     - CREATE VIEW command denied to user 'ghostadm'@'11.1.0.1' for table `ghost_some_xyz`.`members_resolved_subscription`

{"config":{"transaction":false},"name":"2026-06-09-09-00-01-add-members-resolved-subscription-view.js"}
"Error occurred while executing the following migration: 2026-06-09-09-00-01-add-members-resolved-subscription-view.js"

Error ID:
    300

Error Code: 
    ER_TABLEACCESS_DENIED_ERROR

That very installation worked a okey until now when I’m trying new docker image.

Also, the same mysql server/host and another ghost did migrate/update to the same docker image without issue. I supposed it’s that very database rather than the host/mysql itself.

Any ideas what/where to troubleshoot or perhaps you have a “fix” for it?

thanks, L.

Originally:

MariaDB [(none)]> grant create,select,insert,update,delete,alter,drop on ghost_some_xyz.*...

If one prefers - which fixes above issue - not to:

MariaDB [(none)]> grant all privileges on ghost_some_xyz.*

Which specific privileges were missing from that first grant option?

The one you were missing is CREATE VIEW. In MySQL/MariaDB that is a separate privilege from CREATE, which only covers tables and databases. Ghost’s newer migrations create views, so a user with just CREATE fails exactly here.

Add SHOW VIEW as well, otherwise mysqldump chokes on that view when you back up the database. DROP you already had, and that one is needed for CREATE OR REPLACE on an existing view.

So if you want to stay tight instead of ALL PRIVILEGES:

grant create, create view, show view, select, insert, update, delete, alter, drop on ghost_some_xyz.* to ‘ghostadm’@‘11.1.0.1’;

Your other Ghost on the same server probably just had ALL, which is why it went through.