Copying SQL tables possible?

Discussion in 'OT Technology' started by ManinCamo, Oct 25, 2005.

  1. ManinCamo

    ManinCamo I wear big boy pants.

    Joined:
    Jul 5, 2001
    Messages:
    4,670
    Likes Received:
    0
    Location:
    '01 OG
    In my database class, we're working as a group on a project. Most of it is in SQL.

    One of the guys in the group has the newest and best and most complete version of everything, but we don't have all of the original scripts saved.

    Is there anywhere to copy all of that data onto a zip drive or something and reload it onto the other group members individual SQL databases so that we can work from the same copy?
     
  2. kingtoad

    kingtoad OT Supporter

    Joined:
    Sep 2, 2003
    Messages:
    55,914
    Likes Received:
    8
    Location:
    Los Angeles
    Yes. There is an actual command you could send to your MySQL shell that will dump the database into a file, but I cannot think of it at this time. Additionally, you could use PHPMyAdmin's "back up" feature to do this. It will dump your SQL into an *.sql file and generate create database/create table strings along with your data and fields.
     
  3. CyberBullets

    CyberBullets I reach to the sky, and call out your name. If I c

    Joined:
    Nov 13, 2001
    Messages:
    11,865
    Likes Received:
    0
    Location:
    BC, Canada/Stockholm, Sweden
    CREATE TABLE newTableName SELECT * FROM oldTableName
     
  4. zabuni

    zabuni New Member

    Joined:
    Jan 2, 2005
    Messages:
    64
    Likes Received:
    0
    On the console:

    man sqldump

    This command will convert an entire database to sql commands. These can be fed back into another database.
     
  5. Penguin Man

    Penguin Man Protect Your Digital Liberties

    Joined:
    Apr 27, 2002
    Messages:
    21,696
    Likes Received:
    0
    Location:
    Edmonton, AB
    This depends on what DB you're using. We use Oracle at school and there's no such command (or I can't run it at least).
     

Share This Page