Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

renaming table in database, restoring data to table

Status
Not open for further replies.

csross

MIS
Dec 21, 2003
92
US
I am new at mysql.

A consultant recently hired at my company overlayed/wiped- out a table in a database I created for him. This database was a copy of a live database so I have the original table data he deleted.

How do I rename the product table he created to os-product, it must live in the same database?

How do I create a the product table and import the original data from the live database?

Any help would be appreciated.
Csross
 
To rename a table:

alter table product rename os-product;


To create a table based on your 'live' table:

create table product select * from yourlivedatabase.product;

[This assumes both databases are located on the same machine.]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top