3326
MySQLERRORNotableResource GroupsHIGH confidence

Resource group already exists

Production Risk

Low — DDL fails; existing group is unchanged.

How to reproduce
trigger — this will error
trigger — this will error
CREATE RESOURCE GROUP rg_existing TYPE = USER VCPU = 0;

expected output

ERROR 3326 (HY000): Resource group 'rg_existing' already exists.

Fix

Use IF NOT EXISTS

Use IF NOT EXISTS
CREATE RESOURCE GROUP IF NOT EXISTS rg_existing TYPE = USER VCPU = 0;

Why this works

IF NOT EXISTS makes the statement idempotent.

What not to do

Sources
Official documentation ↗

MySQL 8.0 — 3326 ER_RESOURCE_GROUP_EXISTS

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All MySQL errors