How to copy a MySql structure from one place to another?

  • WritingBadCode
  • Graduate
  • Graduate
  • User avatar
  • Posts: 214
  • Loc: Sweden

Post 3+ Months Ago

If I make a database and add a bunch of tables to it. Is there a easy way to just copy the whole database structure from one place (local) to a online homepage or must I go and open each table and see varchar(45), int(11) etc and type all that in manually?

I see phpmyadmin has a Copy database to function under operations, but that only lets me copy things local to local. I'm sure there must be a way to copy the database to a file and just run it on a new server to save some time (and also lower the risk of typing errors!)!

So...

Any suggestions?
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Don2007
  • Web Master
  • Web Master
  • Don2007
  • Posts: 4924
  • Loc: NY

Post 3+ Months Ago

Why can't FTP be used to transfer the entire file?
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9089
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

In phpMyAdmin, once you have your database selected, click on the Export tab on the top right. On that page, if you only want the structure with no data, make sure you uncheck the data box. Then at the bottom make sure "Save as file" is checked, and then you should be able to save this as a file to your computer. At that point you can goto your other server and use phpMyAdmin to import it back in with the Import tab.
  • WritingBadCode
  • Graduate
  • Graduate
  • User avatar
  • Posts: 214
  • Loc: Sweden

Post 3+ Months Ago

Bigwebmaster wrote:
In phpMyAdmin, once you have your database selected, click on the Export tab on the top right. On that page, if you only want the structure with no data, make sure you uncheck the data box. Then at the bottom make sure "Save as file" is checked, and then you should be able to save this as a file to your computer. At that point you can goto your other server and use phpMyAdmin to import it back in with the Import tab.


I tried this and it works the way I want! Thanks.


Don2007 wrote:
Why can't FTP be used to transfer the entire file?


Not sure how well you read my initial post (I wrote: I'm sure there must be a way to copy the database to a file), I didn't know what file to transfer/create and needed some step by step instructions. Problem solved now tho, thanks for your input anyway. :)
  • Zealous
  • Guru
  • Guru
  • User avatar
  • Posts: 1241
  • Loc: Sydney

Post 3+ Months Ago

Bigwebmaster wrote:
In phpMyAdmin, once you have your database selected, click on the Export tab on the top right. On that page, if you only want the structure with no data, make sure you uncheck the data box. Then at the bottom make sure "Save as file" is checked, and then you should be able to save this as a file to your computer. At that point you can goto your other server and use phpMyAdmin to import it back in with the Import tab.


it makes me wonder sometimes that no one uses phpmyadmin, what a great program

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 56 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.