we've been making changes in the MySQL database, adding tables, columns and so forth and I have a deve开发者_开发知识库lopment/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 phpMyAdmin to administer it to date.
On local dev system:
$ mysqldump -u username -p databasename > export.sql
On remote system:
$ mysql -u username -p databasename
mysql> source pathto/export.sql
Check out mysqldump, a command line tool that comes with MySQL, here:
- http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html
Using it, you can take a snapshot of both the structure and the data of your database and import it elsewhere.
精彩评论