MySQL table - change or rename MySql table name change mysql table name, change table name, mysql table, rename table, rename mysql table
Rename MySQL table - Change MySQL table name:
Database or website admin work sometimes asks for simple tasks like renaming a mysql table.
Say you have a mysql database named test and, inside it, you have the following 3 tables:
$ mysql -u root -ppassword test Welcome to the MySQL monitor. Commands end with ; or g. Your MySQL connection id is 11342 Server version: 5.0.45-log FreeBSD port: mysql-server-5.0.45_1
Type 'help;' or 'h' for help. Type 'c' to clear the buffer.
mysql> show tables; +----------------+ | Tables_in_test | +----------------+ | Table_test1 | | Table_test2 | | Table_test3 | +----------------+ 3 rows in set (0.00 sec) mysql>
and you want to change the name of Table_test1's table into new_table. This is done by using using the mysql rename table syntax: RENAME TABLE old_table TO new_table
Hello, Guest ! You can Login or Register to www.ivorde.ro!
Post comment:
3 comment(s) to MySQL table - change or rename MySql table name:
1. Re: MySQL table - change or rename MySql table name
mysql select by Andrei
at August 02nd, 2010 - 15:00
You can try: SELECT fist_table.columnA AS something from first_table, second_table.columnA as something-else from second_table.... and so on.
2. Re: MySQL table - change or rename MySql table name
Tabels , name changing by Arash
at August 02nd, 2010 - 10:54
I have 2 questions :
1. Suppose we have 20 tables which all of them have got the same columns (the number of the columns and the name of the columns are all same ). How can I combine and convert all of them into a single Table.
2. Imagine we have the same case as explained above( 20 tables with same columns ), so we want to change the name of each tables to the same name which is in first row of Third column of each table.
any one have got some codes or solution for that ?
Thx
3. Re: MySQL table - change or rename MySql table name
Designed and developed by Andrei Manescu. Optimized for Mozilla Firefox.
Copyright 2007 Andrei Manescu
All trademarks and copyrights on this page are owned by their respective owners. Comments are owned by those who posted them.