Skip to main content
Inspiring
January 23, 2008
Question

How do I change the name of a MySQL table?

  • January 23, 2008
  • 7 replies
  • 405 views
Hi All,

I would like to change the name of one of my tables. I unwittingly
named my MySQL table using one of the reserved words, GROUP. Now I
would like to change that to GRP to avoid any problems. I can't see a
way to do that. Does anyone know the secret?

TIA
This topic is closed to new replies. Start a new post to keep the conversation going.

7 replies

Inspiring
January 29, 2008
.oO(jsteinmann)

> phpadmin is certainly nice, but don't ignore how great the mysql gui
>tools are. for anyone that's worked with enterprise manager, it's a
>real breeze. It's very straight forward.

Even the command line is usually much better and faster than phpMyAdmin
if you know how to use it:

mysql> RENAME TABLE oldTable TO newTable;

Can't get easier than that.

Micha
January 29, 2008
phpadmin is certainly nice, but don't ignore how great the mysql gui tools are. for anyone that's worked with enterprise manager, it's a real breeze. It's very straight forward.
Inspiring
January 23, 2008
Brett wrote:

> Hi All,
>
> I would like to change the name of one of my tables. I unwittingly
> named my MySQL table using one of the reserved words, GROUP. Now I
> would like to change that to GRP to avoid any problems. I can't see a
> way to do that. Does anyone know the secret?
>
> TIA

ALTER TABLE `GROUP` RENAME `GRP`;
Mick
Inspiring
January 23, 2008
Thanks hconnorjr.

I already did what Murray suggested. The hardest part was doing a Find
& Replace on all instances of the table name and its fields.
Inspiring
January 23, 2008
Thanks Murray.
Inspiring
January 23, 2008
use phpmyadmin, go in and change the table name. its under the operations tab. but keep in mind that if you do this, you may have to rebuild your server behaviors, since they will be looking for the old table name. hope that helps.
Inspiring
January 23, 2008
You can always export from that table, edit the SQL, and re-import.

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================


"Brett" <nospam@address.withheld> wrote in message
news:fn86l9$bb$1@forums.macromedia.com...
> Hi All,
>
> I would like to change the name of one of my tables. I unwittingly named
> my MySQL table using one of the reserved words, GROUP. Now I would like
> to change that to GRP to avoid any problems. I can't see a way to do
> that. Does anyone know the secret?
>
> TIA