# Create or replace view \`members\_resolved\_subscription\` as - ER\_TABLEACCESS\_DENIED\_ERROR

**URL:** <https://forum.ghost.org/t/create-or-replace-view-members-resolved-subscription-as-er-tableaccess-denied-error/63747>\
**Category:** Installation\
**Created:** [September 11, 2026, 7:35am UTC](https://forum.ghost.org/t/create-or-replace-view-members-resolved-subscription-as-er-tableaccess-denied-error/63747 "2026-09-11T07:35:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lejeczek](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/lejeczek/32/18989_2.png) [@lejeczek](https://forum.ghost.org/u/lejeczek)\
**Post date:** [September 11, 2026, 7:35am UTC](https://forum.ghost.org/t/create-or-replace-view-members-resolved-subscription-as-er-tableaccess-denied-error/63747/1 "2026-09-11T07:35:56Z")

</div>

Hi guys.

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

```auto
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.

---

<div class="post-metadata">

**Author:** ![lejeczek](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/lejeczek/32/18989_2.png) [@lejeczek](https://forum.ghost.org/u/lejeczek)\
**Post date:** [September 11, 2026, 8:27am UTC](https://forum.ghost.org/t/create-or-replace-view-members-resolved-subscription-as-er-tableaccess-denied-error/63747/3 "2026-09-11T08:27:18Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![rlemon](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/rlemon/32/41517_2.png) [@rlemon](https://forum.ghost.org/u/rlemon)\
**Post date:** [September 11, 2026, 11:35am UTC](https://forum.ghost.org/t/create-or-replace-view-members-resolved-subscription-as-er-tableaccess-denied-error/63747/4 "2026-09-11T11:35:34Z")

</div>

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.
