tags:

views:

30

answers:

2

Hi, we've been making changes in the mysql database, adding tables, columns and so forth and I have a development/staging site and production. All are MySQL, staging and production hosted remote.

How do I export the table structure and bring it into the production environment?

I have been using myphpadmin to administer it to date.

Thanks.

A: 

Check out mysqldump, a command line tool that comes with MySQL, here:

Using it, you can take a snapshot of both the structure and the data of your database and import it elsewhere.

wsorenson
I would be able to use that on a remotely hosted mysql (Joyent)?
Angela
A: 

On local dev system :

$ mysqldump -u username -p databasename > export.sql

On remote system :

$ mysql -u username -p databasename

mysql> source pathto/export.sql

s1d
Would I do an import? Would that take both the data and the structure? What if I just want structure?
Angela
To export only structure, use the following command :$ mysqldump -u username -p databasename --no-data > export.sql
s1d