|
Mysql Application & Query Optimization, Questions, Indexes, Bugs.
Author |
Message |
admin
|
 |
Post subject: MySql rename table | Posted: Wed Feb 02, 2011 6:15 pm |
|
Site Admin
Joined: Mon Aug 03, 2009 8:43 am Posts: 104
|
MySql rename table
To rename a mysql table from old_name to new_name, command is: Quote: mysql> RENAME TABLE old_name TO new_name
_________________ VPSie - SSD VPS servers in AMS-IX, LINX, DE-CIX https://vpsie.com
|
|
|
|
|
|
admin
|
 |
Post subject: Re: MySql rename table | Posted: Sun Nov 13, 2011 2:01 pm |
|
Site Admin
Joined: Mon Aug 03, 2009 8:43 am Posts: 104
|
If the table's name happens to use special mysql characters ( like percentage char %), enclose the table name as follows: Code: mysql> rename table `%TABLE_PREFIX%email` to email; Query OK, 0 rows affected (0.02 sec)
_________________ VPSie - SSD VPS servers in AMS-IX, LINX, DE-CIX https://vpsie.com
|
|
|
|
|
Darwin
|
 |
Post subject: Re: MySql rename table | Posted: Mon Nov 28, 2011 3:39 am |
|
Joined: Tue Nov 08, 2011 7:57 am Posts: 3
|
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';
|
|
|
|
|
|
Topics related to - "MySql rename table" |
Topics |
Author |
Replies | Views |
Last post |
 |
 |
Rename MySql table
|
debuser |
1 |
2348 |
Fri Oct 08, 2010 1:36 am
sonee4
|
 |
|
Mysql: add column to table
|
debuser |
1 |
4235 |
Fri Oct 08, 2010 1:38 am
sonee4
|
 |
|
Mysql add Unique index to a table column
|
debuser |
0 |
3274 |
Fri Aug 06, 2010 10:01 am
debuser
|
 |
|
Mysql remove column from an existing table
|
debuser |
0 |
2304 |
Fri Aug 06, 2010 10:06 am
debuser
|
 |
|
MySql doesn't start: libexec/mysqld: File './mysql-bin.index' not found (Errcode: 13)
|
debuser |
0 |
3192 |
Mon Feb 22, 2010 1:43 pm
debuser
|
 |
|
How to use a mysql stored procedure
|
debuser |
1 |
2317 |
Tue Nov 22, 2011 1:23 am
Darwin
|
 |
 |
Mysql: Cleaning binary logs
|
debuser |
1 |
2740 |
Tue May 18, 2010 9:45 am
designeru
|
 |
 |
Mysql change column's default value
|
debuser |
0 |
2758 |
Thu Aug 12, 2010 3:43 am
debuser
|
 |
|
Mysql drop (remove) unique key
|
mandrei99 |
0 |
2692 |
Wed Jan 14, 2015 7:53 pm
mandrei99
|
 |
|
Mysql change root password
|
mandrei99 |
0 |
2904 |
Tue Feb 10, 2015 6:50 pm
mandrei99
|
|
Users browsing this forum: No registered users and 0 guests |
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
News Site map SitemapIndex RSS Feed Channel list
|
|