Linux, FreeBSD, Juniper, Cisco / Network security articles and troubleshooting guides

It is currently Thu Dec 07, 2023 8:55 am

Post a reply :: MySql rename table
Message body:
Enter your message here, it may contain no more than 60000 characters. 

:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:
Font size:
Font colour
BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON
Disable BBCode
Disable smilies
Do not automatically parse URLs
Confirmation code
Confirmation code:
In an effort to prevent automatic submissions, we require that you enter both of the words displayed into the text field underneath.

Topic review - MySql rename table
Author Message
Post subject: Re: MySql rename table  |  Post Posted: Mon Nov 28, 2011 3:39 am
You can try to do exact same thing with Information_Schema.Columns table
Something like
select concat('rename table ', column_name, ' to ' , lower(column_name) , ';')
from information_schema.columns where table_schema = 'your_schema_name';
Post subject: Re: MySql rename table  |  Post Posted: Sun Nov 13, 2011 2:01 pm
If the table's name happens to use special mysql characters ( like percentage char %), enclose the table name as follows:
mysql> rename table `%TABLE_PREFIX%email` to email;
Query OK, 0 rows affected (0.02 sec)
Post subject: MySql rename table  |  Post Posted: Wed Feb 02, 2011 6:15 pm
To rename a mysql table from old_name to new_name, command is:
mysql> RENAME TABLE old_name TO new_name
Jump to:  
cronNews News Site map Site map SitemapIndex SitemapIndex RSS Feed RSS Feed Channel list Channel list

Delete all board cookies | The team | All times are UTC - 5 hours [ DST ]