You are here: Re: How do I copy a table for backup and restore purposes « PHP SQL « IT news, forums, messages
Re: How do I copy a table for backup and restore purposes

Posted by Flemming on 11/27/07 05:18

>>Is there a way to create (an empty) NewTable in SQL with indexes and all
>>from OldTable?
>>
>>Flemming
>>
>
> I usually create my own "config" files, that I use similar to restoring
> from a
> backup. As an example, I'll create a file named OldTable.sql that includes
> the
> SQL commands for creating the table and adding its indexes, and using a
> command
> like this to create the table...
>
> mysql -u username -p database_name < /path/to/OldTable.sql
>
> If I need to create a similar or duplicate table, I can copy that to a
> NewTable.sql file, and edit that with whatever changes I needed. Then add
> that
> one using..
>
> mysql -u username -p database_name < /path/to/NewTable.sql
>
> That way you can duplicate a table design a lot easier.
>
Thank you for another helpful suggestion. I'll keep that in mind and use it
in the future.

Flemming

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация