Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How do I change the name of a MySQL table?

LEGEND ,
Jan 23, 2008 Jan 23, 2008
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
TOPICS
Server side applications
399
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 23, 2008 Jan 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jan 23, 2008 Jan 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.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 23, 2008 Jan 23, 2008
Thanks Murray.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 23, 2008 Jan 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.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 23, 2008 Jan 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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jan 28, 2008 Jan 28, 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.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 29, 2008 Jan 29, 2008
LATEST
.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
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines