SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict y_oda2002's Avatar
    Join Date
    May 2005
    Posts
    219
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Importing database table structure

    Hi everyone,

    I was wondering if anyone knows of a way to write the structure of a database to a file so you could easily import it from one server to another without having to write all the table creation queries again. All i need to be able to import from one server to the next is the database structure. The information does not have to stay intact. I heard it could be done but have not figured it out. Any help would be greatly appreciative.

    Thanks,

    Nick

  2. #2
    SitePoint Addict
    Join Date
    Jul 2004
    Location
    The Caribbean
    Posts
    267
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Nick, the mysqldump command can output all your table data including table definitions and entries. This can be redirected to a file, and then you can use 'mysql -u user -p database_name< filename.sql' to restore that information on your new server. It looks like using the '-d' or '--no-data' flag for mysqldump will skip dumping the rows.

  3. #3
    SitePoint Addict y_oda2002's Avatar
    Join Date
    May 2005
    Posts
    219
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks,

    Nick


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •