Skip to main content
Inspiring
Jan 23, 2008 8:04 PM UTC
Question

How do I change the name of a MySQL table?

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
Jan 29, 2008 1:39 PM UTC
.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
Translate
Jan 29, 2008 7:23 AM UTC
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.
Translate
Inspiring
Jan 23, 2008 11:06 PM UTC
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
Translate
Inspiring
Jan 23, 2008 9:30 PM UTC
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.
Translate
Inspiring
Jan 23, 2008 9:27 PM UTC
Thanks Murray.
Translate
Inspiring
Jan 23, 2008 8:54 PM UTC
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.
Translate
Inspiring
Jan 23, 2008 8:08 PM UTC
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

Translate