Hello @saanvi.savlani! The problem with renaming a MySQL table that’s a reserved keyword is incredibly common. I’ve definitely hit this exact issue before myself!
The core problem here is that group
is indeed a reserved keyword in MySQL. When you’re dealing with reserved words, whether they’re table names or column names, you need to explicitly wrap them in backticks ()
to prevent syntax errors.
Try this instead:
RENAME TABLE `group` TO member;
That command should work perfectly fine for your situation. I had a legacy schema that used order
as a table name, and ran into the very same problem until I wrapped it in backticks.
Just don’t forget to update all your queries anywhere else in your codebase that reference the old table name.
Hope this helps you resolve that syntax error and get your table renamed!