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

  • WritingBadCode
  • Graduate
  • Graduate
  • User avatar
  • Joined: Apr 28, 2011
  • Posts: 214
  • Loc: Sweden
  • Status: Offline

Post June 11th, 2011, 7:36 am

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
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post June 11th, 2011, 7:36 am

  • Don2007
  • Web Master
  • Web Master
  • No Avatar
  • Joined: Nov 21, 2006
  • Posts: 4924
  • Loc: NY
  • Status: Offline

Post June 11th, 2011, 10:09 am

Why can't FTP be used to transfer the entire file?
How do you know when a politician is lying? His mouth is moving.
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Joined: Dec 20, 2002
  • Posts: 8934
  • Loc: Seattle, WA & Phoenix, AZ
  • Status: Online

Post June 11th, 2011, 10:33 am

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.
Ozzu Hosting - Want your website on a fast server like Ozzu?
  • WritingBadCode
  • Graduate
  • Graduate
  • User avatar
  • Joined: Apr 28, 2011
  • Posts: 214
  • Loc: Sweden
  • Status: Offline

Post June 11th, 2011, 11:31 am

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
  • Joined: Apr 15, 2011
  • Posts: 1202
  • Loc: Sydney
  • Status: Offline

Post June 24th, 2011, 1:26 am

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 158 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
 
cron
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.